Standard Java Graphics

Standard Java graphics are a bit weird. All drawing on the screen results from implicit or explicit calls of repaint() method, which posts an event on the event queue and eventually results in the paint method being called.

Below we explain how to pop up a window and to create and draw geometric objects in the window. We then see what extra must be done to draw images loaded from a file. Finally we show how to do simple animations using a timer to trigger redrawing of the images.