import java.applet.*;
import java.awt.*;
/**/
public class stickman extends Applet
{
public void init() //initialisation
{
setBackground(Color.black);
setForeground(Color.red);
}
public void paint(Graphics g) //to display stickman in applet window
{
//creating a head
g.drawOval(90,60,20,20);
//creating a body
g.drawLine(100,80,100,150);
//creating two hands
g.drawLine(100,100,140,80);
g.drawLine(100,100,75,80);
//creating two legs
g.drawLine(100,150,70,180);
g.drawLine(100,150,130,180);
}
}
No comments:
Post a Comment