/*Program Displaying the human face
suing basic figures, circles, arcs, lines, etc. Done using Applets.*/
Face.html
<html>
<body>
<applet code = "Face.class" width = 300 height =300>
</applet>
</body>
</html>
Code for Face.java
import java.awt.*;
import java.applet.*;
public class Face extends Applet
{
public void paint(Graphics g)
{
g.drawString("Hi !!!!!!!!!!!!!!! I Am Bean.",20,30);
g.drawArc(30,50,200,200,0,360); // Main Face
g.drawArc(82,80,30,30,20,160); //Left Eye Brow
g.fillArc(85,85,25,25,0,360); //Left Eye
g.drawArc(152,80,30,30,20,160); //Right Eye Brow
g.fillArc(155,85,25,25,0,360); //Right Eye
g.drawRect(90,190,80,20); //Mouth
g.drawLine(130,135,115,160); //Nose Left Line
g.drawLine(130,135,145,160); // Nose Right Line
g.drawLine(115,160,145,160); // Nose Base
g.drawString(" ------------- Created By SP.",10,350);
}
}
To execute the applet by appletviewer tool, write in command prompt:
c:\>javac Face.java
c:\>appletviewer Face.html
Output :
ConversionConversion EmoticonEmoticon