11.9. Summary

The whiteboard presented in Section 11.8 is not too bad for such a small amount of code, but it is lacking in several ways. First, there are no options for choosing colors or fonts or for specifying the type of drawing operation (freehand, straight lines, circles, rectangles, and so forth). In Chapter 13 (AWT Components), we cover combo boxes, pull-down menus, and other GUI widgets needed to create such an interface. Second, because drawing is done directly to the window, it is transient. If another window is moved over the browser and then removed, the drawing is lost. In Chapter 16 (Concurrent Programming with Java Threads), we discuss several techniques for overcoming this problem, the most general of which is double buffering, ...

Get Core Web Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.