Compile and run the previous example (class Sheet). Try changing things, so you are sure you understand everything it does.
Look at the API documentation for java.awt.Graphics
and java.awt.Graphics2D
and try some of the other drawing methods found there.