import java.awt.Graphics;
import javax.swing.JFrame;

public class Tuesday {
  public static void main(String[] args) {
    JFrame a = new JFrame(); 
    int width = 500, height = 500; 
    a.setVisible(true); 
    a.setSize(width+20, height+40); 
    // how can you determine 20, 40 dynamically? 
    Penguin b = new Penguin(width, height); 
    a.add(b);     
  }
}

import javax.swing.JComponent;
import java.awt.Graphics; 
import java.awt.Color;
import java.awt.Polygon;

public class Penguin extends JComponent {
  int width, height; 
  public Penguin(int width, int height) {
    this.width = width;
    this.height = height; 
  }
  public void paintComponent(Graphics g) {
    // default color is Color.BLACK 
    g.drawOval(  0,   0, 500, 500); // circle in the background (not necessary) [ 0] 
    g.setColor(Color.WHITE); 
    g.fillRect(  0,   0, 500, 500); // background (see marks by circle)         [ 0] 
    g.setColor(Color.BLACK);        // used by body                             [ 1]
    int left = 5;
    g.fillOval( 80-left,  50, 365, 400); // body                                [ 1] 
    g.setColor(new Color(220, 220, 220)); 
    g.fillOval(120-left, 190, 290, 250); // larger belly                        [ 2] 
    g.setColor(Color.WHITE); 
    g.fillOval(155-left, 195, 220, 240); // smaller belly                       [ 3]
    g.setColor(new Color(240, 200, 40)); // some gold 
    g.fillOval( 85-left, 390, 175,  80); // right foot (left)                   [ 4] 
  }
}

... and so on. Present today: 

wang686  luo23  hgarciah  zeyang 
  mahazuga runxzhao rthammon zhang486 balbakr ssalmero
--------------------------------------------------------
   ruifan              mzelenin        jnp2 
   kevcao  dweissma  serepate  yiwecao 

Absent: creba 

import javax.swing.JFrame;

public class FaceViewer
{
   public static void main(String[] args)
   {
      JFrame frame = new JFrame();
      frame.setSize(150, 250);
      frame.setTitle("An Alien Face");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      FaceComponent component = new FaceComponent();
      frame.add(component);

      frame.setVisible(true);
   }
}

--

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import javax.swing.JComponent;

/*
   A component that draws an alien face
*/
public class FaceComponent extends JComponent
{  
   public void paintComponent(Graphics g)
   {  
      // Recover Graphics2D 
      Graphics2D g2 = (Graphics2D) g;

      // Draw the head
      Ellipse2D.Double head = new Ellipse2D.Double(5, 10, 100, 150);
      g2.draw(head);

      // Draw the eyes
      g2.setColor(Color.GREEN);
      Rectangle eye = new Rectangle(25, 70, 15, 15);
      g2.fill(eye);
      eye.translate(50, 0);
      g2.fill(eye);

      // Draw the mouth
      Line2D.Double mouth = new Line2D.Double(30, 110, 80, 110);
      g2.setColor(Color.RED);
      g2.draw(mouth);

      // Draw the greeting
      g2.setColor(Color.BLUE);
      g2.drawString("Hello, World!", 5, 175);
   }
}

--

http://silo.cs.indiana.edu:8346/c212/milestones/ch02/section_10/

http://silo.cs.indiana.edu:8346/c212/milestones/ch02/