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>
*/
/* 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>
*/