java.awt

Class CheckboxMenuItem

  • All Implemented Interfaces:
    ItemSelectable, java.io.Serializable, javax.accessibility.Accessible
    public class CheckboxMenuItem extends MenuItem implements ItemSelectable, javax.accessibility.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
    • Constructors 
      Constructor and Description
      Ordinary member indicator CheckboxMenuItem Reveal DetailHide Detail
      Create a check box menu item with an empty label.
      Ordinary member indicator CheckboxMenuItem Reveal DetailHide Detail
      Create a check box menu item with the specified label.
      Ordinary member indicator CheckboxMenuItem Reveal DetailHide Detail
      Create a check box menu item with the specified label and state.
    • Methods 
      Modifier and Type Method and Description
      Inherited member indicator addActionListener Reveal DetailHide Detail
      Adds the specified action listener to receive action events from this menu item.
      Ordinary member indicator addItemListener Reveal DetailHide Detail
      Adds the specified item listener to receive item events from this check box menu item.
      Overridden member indicator addNotify Reveal DetailHide Detail
      Creates the peer of the checkbox item.
      Inherited member indicator deleteShortcut Reveal DetailHide Detail
      Delete any MenuShortcut object associated with this menu item.
      Inherited member indicator disable Reveal DetailHide Detail
      Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
      Inherited member indicator dispatchEvent Reveal DetailHide Detail
      Delivers an event to this component or one of its sub components.
      Inherited member indicator enable Reveal DetailHide Detail
      Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
      Inherited member indicator enable Reveal DetailHide Detail
      Deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).
      Overridden member indicator getAccessibleContext Reveal DetailHide Detail
      Gets the AccessibleContext associated with this CheckboxMenuItem.
      Inherited member indicator getActionCommand Reveal DetailHide Detail
      Gets the command name of the action event that is fired by this menu item.
      Inherited member indicator getActionListeners Reveal DetailHide Detail
      Returns an array of all the action listeners registered on this menu item.
      Inherited member indicator getFont Reveal DetailHide Detail
      Gets the font used for this menu component.
      Ordinary member indicator getItemListeners Reveal DetailHide Detail
      Returns an array of all the item listeners registered on this checkbox menuitem.
      Inherited member indicator getLabel Reveal DetailHide Detail
      Gets the label for this menu item.
      Overridden member indicator getListeners Reveal DetailHide Detail
      Returns an array of all the objects currently registered as FooListeners upon this CheckboxMenuItem.
      Inherited member indicator getName Reveal DetailHide Detail
      Gets the name of the menu component.
      Inherited member indicator getParent Reveal DetailHide Detail
      Returns the parent container for this menu component.
      Inherited member indicator getPeer Reveal DetailHide Detail
      Deprecated. As of JDK version 1.1, programs should not directly manipulate peers.
      Ordinary member indicator getSelectedObjects Reveal DetailHide Detail
      Returns the an array (length 1) containing the checkbox menu item label or null if the checkbox is not selected.
      Inherited member indicator getShortcut Reveal DetailHide Detail
      Get the MenuShortcut object associated with this menu item,
      Ordinary member indicator getState Reveal DetailHide Detail
      Determines whether the state of this check box menu item is "on" or "off."
      Inherited member indicator isEnabled Reveal DetailHide Detail
      Checks whether this menu item is enabled.
      Overridden member indicator paramString Reveal DetailHide Detail
      Returns a string representing the state of this CheckBoxMenuItem.
      Inherited member indicator postEvent Reveal DetailHide Detail
      Deprecated. As of JDK version 1.1, replaced by dispatchEvent.
      Inherited member indicator removeActionListener Reveal DetailHide Detail
      Removes the specified action listener so it no longer receives action events from this menu item.
      Ordinary member indicator removeItemListener Reveal DetailHide Detail
      Removes the specified item listener so that it no longer receives item events from this check box menu item.
      Inherited member indicator removeNotify Reveal DetailHide Detail
      Removes the menu component's peer.
      Inherited member indicator setActionCommand Reveal DetailHide Detail
      Sets the command name of the action event that is fired by this menu item.
      Inherited member indicator setEnabled Reveal DetailHide Detail
      Sets whether or not this menu item can be chosen.
      Inherited member indicator setFont Reveal DetailHide Detail
      Sets the font to be used for this menu component to the specified font.
      Inherited member indicator setLabel Reveal DetailHide Detail
      Sets the label for this menu item to the specified label.
      Inherited member indicator setName Reveal DetailHide Detail
      Sets the name of the component to the specified string.
      Inherited member indicator setShortcut Reveal DetailHide Detail
      Set the MenuShortcut object associated with this menu item.
      Ordinary member indicator setState Reveal DetailHide Detail
      Sets this check box menu item to the specifed state.
      Inherited member indicator toString Reveal DetailHide Detail
      Returns a representation of this menu component as a string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge