Subject: (no subject)

From: [email-masked]
Date: Sun, 7 May 2000 23:33:42 EDT

//CS5-HMC-Sp.,00-HW5-4
//A. Khakpour, May, 00

import java.applet.*;
import java.awt.*;

public class Quilt1 extends Applet
{
   private final int GS = 12;      //Grid Size
   private final int CS = 24;      //Cell Size

   public void paint(Graphics g)
   {
      int x, y;
      setBackground (Color.black);
      for (int row=1; row <= GS; row++)
      {
         y = row * CS;
         for (int col=1; col <= GS; col++)
         {
            x = col * CS;
            g.setColor (Color.magenta);
            g.fillRect (x, y, CS, CS);
            g.setColor (Color.cyan);
            g.fillOval (x, y, CS, CS);
            g.setColor (Color.yellow);
            g.fillOval (x+CS/8, y+CS/8, 3*CS/4, 3*CS/4);
            g.setColor (Color.red);
            g.fillOval (x+CS/4, y+CS/4, CS/2, CS/2);
            g.setColor (Color.black);
            g.drawLine (x, y+CS/2, x+CS, y+CS/2);
            g.drawLine (x+CS/2, y, x+CS/2, y+CS);
         }
      }
   }
}