Click to reopen instructions.

This environment, unlike the Java Canvas demo some of you hve played with, gives you access to the full java.awt.Graphics API. Your code’s draw method will be called with a Graphic object, a width, and a height and can use any of the methods on the Graphic object to draw an image. The image will be generated and returned to this webpage and displayed on the right. You should use the width and height arguments to make your code resilliant in the face of changing window sizes.

Some things to try:

  • Draw a circle in the center of the drawing area whose size is some fraction of the height of the drawing area.
  • Draw two circles, centered vertically, one 1/4 of the way from the left side of the drawing area and the other 1/4 of the way from the right side.
  • Draw two circles that are just touching.
  • Draw a rectangle that exactly enclosed the two touching circles.
  • Whatever you want! Experiment with generative art or try to make something representational. Be sure to read the docs linked above to find out what all you can do with the Graphics object.

Put definitions here.

Revisions:

Simple graphics

Compilation errors