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.