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

Mutually Exclusive Groups of Checkboxes

It is often the case that a group of checkboxes is used to represent a set of mutually exclusive options. Our next applet adds a pair of checkboxes to a checkbox group to facilitate choosing whether to print all the pages of a hypothetical document or whether to print only a specified range of pages. When the Print All checkbox is checked, the labels and textfields associated with range printing are disabled. Likewise, checking the Print Range checkbox enables the labels and textfields, in addition to requesting focus for the starting page textfield.

Figure 13-2 shows two snapshots of the applet, one with the Print All checkbox checked, and another with the Print Range checkbox checked.

Figure 13-2. CheckboxTest2 ...

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