Aim:
Develop Programming Working With Graphics.
Procedure:
- Step 1: Open a New Java Application on Netbeans Editor.
- Step 2: Open Netbeans Ide, Choose File -> new Project.
- Step 3: New Open a New Project and Choose a Java Application.
- Step 4: Add a Coding on Coding Windows Using Getter Setter Method.
- Step 5: Run the Index Page and Verify the Result Page.
- Step 6: Save the Project (Ctrl+s).
- Step 7: Run the Project (F5).
Program:
package ex3; import java.awt.*; import java.applet.Applet; public class Ex3 extends Applet { public void paint(Graphics g){ g.setColor(Color.red); g.drawString("Welcome",50, 50); g.drawLine(20,30,20,300); g.drawRect(70,100,30,30); g.fillRect(170,100,30,30); g.drawOval(70,200,30,30); g.setColor(Color.pink); g.fillOval(170,200,30,30); g.drawArc(90,150,30,30,30,270); g.fillArc(270,150,30,30,0,180); } } /*<applet code="GraphicsDemo.class" width="300" height="300"> */
Output:
