110 Program to draw and fill Arc in Java

Code:

/* Program to Draw Arcs in Java */

import java.applet.*;
import java.awt.*;

public class Arc extends Applet
{
public void paint(Graphics g)
{
// void drawArc(int top , left , width , height , startAngle , sweepAngle)

g.setColor(Color.red);
g.drawArc(50 , 100 , 200 , 200 , 0 , 180);

// void fillArc(int top , left , width , height , startAngle , sweepAngle)
g.setColor(Color.green);
g.fillArc(50 , 100 , 200 , 200 , 0 , 180);

}

}

/*
<applet code = "Arc" height = 400 width = 400 >
</applet>
*/




Ouput:

draw and fill Arc in Java

Previous
Next Post »