CheckboxMenuItem (Java Platform SE 8 ) (original) (raw)


public class CheckboxMenuItem
extends MenuItem
implements ItemSelectable, Accessible
This class represents a check box that can be included in a menu. Selecting the check box in the menu changes its state from "on" to "off" or from "off" to "on."
The following picture depicts a menu which contains an instance of CheckBoxMenuItem:
Menu labeled Examples, containing items Basic, Simple, Check, and More Examples. The Check item is a CheckBoxMenuItem instance, in the off state.
The item labeled Check shows a check box menu item in its "off" state.
When a check box menu item is selected, AWT sends an item event to the item. Since the event is an instance of ItemEvent, the processEvent method examines the event and passes it along to processItemEvent. The latter method redirects the event to any ItemListener objects that have registered an interest in item events generated by this menu item.
Since:
JDK1.0
See Also:
ItemEvent, ItemListener, Serialized Form

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.