// DrawSmiley.java
// Demonstrates filled shapes
// Java How To Program page 271
import java.awt.*;

public class DrawSmiley
{
public void draw(Graphics2D g2)
{

// draw the face
g2.setColor( Color.YELLOW );
g2.fillOval( 10, 10, 200, 200 );

// draw the eyes
g2.setColor( Color.BLACK );
g2.fillOval( 55, 65, 30, 30 );
g2.fillOval( 135, 65, 30, 30 );

// draw the mouth
g2.fillOval( 50, 110, 120, 60 );

// "touch up" the mouth into a smile
g2.setColor( Color.YELLOW);
g2.fillRect( 50, 110, 120, 30 );
g2.fillOval( 50, 120, 120, 40 );
} // end method draw
} // end class DrawSmiley

-------------------------------------------------------

// DrawSmileyApplet.java
// Janine Bouyssounouse 2/23/07
import java.applet.*;
import java.awt.*;

public class DrawSmileyApplet extends Applet
{
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D)g;

DrawSmiley s1 = new DrawSmiley();

s1.draw(g2);
} // end paint
} // end class DrawSmileyApplet