Advertisement
Shailrshah

Making a Smiley Face Applet

Oct 20th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.awt.*;
  2. import java.applet.*;
  3. /*<applet code = "MyApplet.class" height = 400 width = 400></applet>*/
  4. public class MyApplet extends Applet{
  5.     public void paint(Graphics g){
  6.         g.setColor(Color.YELLOW);
  7.         g.fillOval(100, 50, 200, 200);          //face
  8.         g.setColor(Color.black);
  9.             g.drawOval(155, 110, 10, 40);           //left eye
  10.             g.fillOval(155, 140, 10, 10);           //left eyeball
  11.             g.drawOval(230, 110, 10, 40);           //right eye
  12.             g.fillOval(230, 140, 10, 10);           //right eyeball
  13.             g.drawLine(190, 170, 210, 170);         //base nose
  14.             g.drawLine(190, 170, 200, 160);         //right nose
  15.             g.drawLine(210,170, 200, 160);          //left nose
  16.             g.drawArc(150, 160, 100, 50, 180, 180);     //upper lip
  17.             g.drawArc(150, 140, 100, 100, 180, 180);    //lower lip
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement