Non-Mutually Exclusive Groups of Checkboxes

You can use checkboxes to represent a set of boolean options that are not mutually exclusive. For example, in a print dialog, you might want to let the user select a number of printing options, as shown in Figure 13-1.

Figure 13-1. CheckboxTest Applet. A set of non-mutually exclusive checkboxes for printing options.

Checking or unchecking any of the four checkboxes in the applet updates the applet's status bar to reflect which items are checked and which are not. The applet is listed in Example 13-1.

Example 13-1. CheckboxTest Applet
 import java.applet.Applet; import java.awt.*; import java.awt.event.*; ...

Get Graphic Java™ 1.2, Volume I: AWT, Third 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.