There are two basic graphics paradigms: painting and drawing. In painting the user can use the mouse to set the color of any pixel. In drawing the user positions shapes by dragging them with the mouse.
Pressing <Ctrl>C erases the drawing.
Pressing <Ctrl>s opens a modal dialog box that allows the user to adjust the color of the drawing and the size of the brush:
The complete program is here: PaintFrame.java .