import java.awt.*; //using abstract library
import java.applet.Applet; //using applets
public class FirstShapes extends Applet //file name FirstShapes, using applets
{ //open class
public void paint (Graphics g) //using graphics
{ //open void
g.drawRect(30,30,80,40); //draw lines for rectangle
g.drawOval(120,30,50,50); //draws oval
g.setColor(Color.red); //choose color
g.fillRect(30,100,80,40); //draw rectangle and fill
g.fillOval(120,100,50,50); //draw oval and fill
g.drawLine(30,160,130,170); //draw line
g.drawArc(30,180,50,50,60,40); //draw arc
g.fillArc(120,180,50,50,60,40); //draw and fill arc
}
}

Copyrighted Material by vmyvnesd