O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.*; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required