Saturday, 12 October 2013

Applet Program to draw human face

//Applet Program to draw human face
// Developed by Ahlam Ansari
import java.awt.*;
import java.applet.*;
/*
<applet code=Face.class width=500 height=500></applet>
*/
public class Face extends Applet
{
public void paint(Graphics ahlam)
        {
               ahlam.drawOval(40,40,120,250);                 //head
               ahlam.drawOval(57,75,30,20);                    //left eye
               ahlam.drawOval(110,75,30,20);                  //right eye
               ahlam.fillOval(68,81,10,10);                       //pupil(l)
               ahlam.fillOval(121,81,10,10);                      //pupil(r)
               ahlam.drawOval(85,100,30,30);                  //nose
               ahlam.fillArc(60,125,80,40,180,180);            //mouth
               ahlam.drawOval(25,92,15,30);                     //ear(l)
               ahlam.drawOval(160,92,15,30);                   //ear(r)
           }
}

/*
C:\Users\Ahlam\Google Drive\My Lectures\Fall\OOPM\Programs>javac Face.java

C:\Users\Ahlam\Google Drive\My Lectures\Fall\OOPM\Programs>appletviewer Face.java

*/

No comments:

Post a Comment