Monday, March 10, 2014

Snowman using Java Applet

import java.awt.*;
import java.applet.*;
public class appletimg extends Applet
{
public void paint(Graphics g)
{
setBackground(Color.red);
//setForeground(Color.white);
g.setColor(Color.white);
        g.fillOval(150,200,200,60);
        g.fillOval(175,150,150,53);
        g.fillOval(200,100,100,53);
        g.fillRect(200,100,100,1);
         g.setColor(Color.black);
        g.fillRect(210,50,80,51);
        g.setColor(Color.black);
g.fillRect(230,115,5,5);
g.fillRect(270,115,5,5);
g.fillRect(250,125,5,5);
g.drawArc(230,115,40,30,230,100);
}
}
/*<applet code="appletimg" width=500 height=500></applet>*/

OUTPUT

No comments: