Small example of how to paint in Swing components, the same in AWT.
The paint method is the one where you can paint. To see what you can paint (Rectangles, circles, ...) you can look at the Java API of the "Graphics" or "Graphics2D" class.