Graphic Java

Java provides a special method for drawing filled in rectangular areas. This method is called fillRect and it takes the same parameters as the drawRect metod:

   g.fillRect(10, 30, 100, 10);
This example will draw a very wide and very short rectangle with its upper-left corner at (10,30).
EXAMPLE: This applet is an approximation of what the student will be expected to create. No code will be offered since the student will need to experiment with the use of the fillRect method to successfully complete this activity.
x

ASSIGNMENT:
There are two ways of approaching this assignment:

  1. The student can think of it as a large cyan square with nine evenly spaced smaller squares drawn on top of it.
  2. The student can think of it as a large black square with eight long rectangles draw over it (four oriented horizontally and four oriented vertically).
In either case the background is yellow.

The student is free to select either strategy for recreating the design.