Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Using what you've learned about the drawing API so far, you can create a simple drawing application. This simple application consists of three classes: the ColorPicker, the ToolSet, and the DrawingCanvas. The DrawingCanvas contains both the tool set and the color picker, and it uses events to set the color and tool when these are clicked. It also handles mouse interaction, creating a new curShape when you press the mouse, and updating it as you move the mouse, depending on the tool, color, and other parameters.
Example 35-15 shows the application, all at once.