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

Checkbox Menu Items

The AWT provides a CheckboxMenuItem class. A CheckboxMenuItem is a menu item that toggles between checked and unchecked when activated. Figure 17-5 shows a CheckboxMenuItem at work.

Figure 17-5. A Checkbox Menu Item. Activated menu items toggle between checked or unchecked.

A CheckboxMenuItem is often used in a menu that exhibits radio button behavior. That is, when one of the menu items is checked, the other items in the menu are all unchecked, so that only one checkbox menu item is checked at a time.

It is a simple matter to extend Menu and provide a RadioMenu class that adds CheckboxMenuItem items (only) and implements the ...

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