![]() |
![]() |
Intro. to Graphics class | |
Drawing - Lines , Rectangles | |
Drawing - Circles and Ellipse | |
Drawing - Arcs | |
Drawing - Polygons | |
Drawing - Bar Charts |
Java Programs | |
Java Keywords Dictionary | |
Java Interview Questions |
Arc is a part of curve or a part of the circumference of a circle.
If a circle is not completed then we can say that it is an ARC.
Java applet has drawArc() method to draw arc. It has 6 arguments.
g.drawArc(int x,int y,int width,int height, int start_angle,int sweep_angle);
Explanation
import java.awt.*; import java.applet.*; /* <applet code="DrawArcEx.class" width=300 height=300> </applet> */ public class DrawArcEx extends Applet { public void paint(Graphics g) { g.drawArc(30, 30, 100, 60,0,180); } }