Applet in JAVA showing a smiling face.

Abhisek
Posted by Abhisek under Others category on | Views : 9172
The following program will display an applet with a smiling face.
import java.awt.*;
import java.applet.*;
/*<html>
<applet code ="Face" width=200 height=200>
</applet>
</html>*/

public class Face extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.red);
g.drawOval(40,40,120,150);
g.drawOval(57,75,30,20);
g.drawOval(110,75,30,20);
g.fillOval(68,81,10,10);
g.fillOval(121,81,10,10);
g.drawOval(85,100,30,40);
showStatus("This is your face");//show the message in the status bar
}
}

Comments or Responses

Login to post response