java.awt
Class CheckboxMenuItem

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.MenuComponent sample code for java.awt.MenuComponent definition code for java.awt.MenuComponent 
      extended by java.awt.MenuItem sample code for java.awt.MenuItem definition code for java.awt.MenuItem 
          extended by java.awt.CheckboxMenuItem
All Implemented Interfaces:
ItemSelectable sample code for java.awt.ItemSelectable definition code for java.awt.ItemSelectable , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

public class CheckboxMenuItem
extends MenuItem sample code for java.awt.MenuItem definition code for java.awt.MenuItem
implements ItemSelectable sample code for java.awt.ItemSelectable definition code for java.awt.ItemSelectable , Accessible sample code for javax.accessibility.Accessible definition code for 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 sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent , ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener , Serialized Form

Nested Class Summary
protected  class CheckboxMenuItem.AccessibleAWTCheckboxMenuItem sample code for java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem definition code for java.awt.CheckboxMenuItem.AccessibleAWTCheckboxMenuItem
          Inner class of CheckboxMenuItem used to provide default support for accessibility.
 
Nested classes/interfaces inherited from class java.awt.MenuItem sample code for java.awt.MenuItem definition code for java.awt.MenuItem
MenuItem.AccessibleAWTMenuItem sample code for java.awt.MenuItem.AccessibleAWTMenuItem definition code for java.awt.MenuItem.AccessibleAWTMenuItem
 
Nested classes/interfaces inherited from class java.awt.MenuComponent sample code for java.awt.MenuComponent definition code for java.awt.MenuComponent
MenuComponent.AccessibleAWTMenuComponent sample code for java.awt.MenuComponent.AccessibleAWTMenuComponent definition code for java.awt.MenuComponent.AccessibleAWTMenuComponent
 
Constructor Summary
CheckboxMenuItem sample code for java.awt.CheckboxMenuItem.CheckboxMenuItem() definition code for java.awt.CheckboxMenuItem.CheckboxMenuItem() ()
          Create a check box menu item with an empty label.
CheckboxMenuItem sample code for java.awt.CheckboxMenuItem.CheckboxMenuItem(java.lang.String) definition code for java.awt.CheckboxMenuItem.CheckboxMenuItem(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  label)
          Create a check box menu item with the specified label.
CheckboxMenuItem sample code for java.awt.CheckboxMenuItem.CheckboxMenuItem(java.lang.String, boolean) definition code for java.awt.CheckboxMenuItem.CheckboxMenuItem(java.lang.String, boolean) (String sample code for java.lang.String definition code for java.lang.String  label, boolean state)
          Create a check box menu item with the specified label and state.
 
Method Summary
 void addItemListener sample code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener) definition code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener) (ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener  l)
          Adds the specified item listener to receive item events from this check box menu item.
 void addNotify sample code for java.awt.CheckboxMenuItem.addNotify() definition code for java.awt.CheckboxMenuItem.addNotify() ()
          Creates the peer of the checkbox item.
 AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext getAccessibleContext sample code for java.awt.CheckboxMenuItem.getAccessibleContext() definition code for java.awt.CheckboxMenuItem.getAccessibleContext() ()
          Gets the AccessibleContext associated with this CheckboxMenuItem.
 ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener [] getItemListeners sample code for java.awt.CheckboxMenuItem.getItemListeners() definition code for java.awt.CheckboxMenuItem.getItemListeners() ()
          Returns an array of all the item listeners registered on this checkbox menuitem.
<T extends EventListener sample code for java.util.EventListener definition code for java.util.EventListener >
T[]
getListeners sample code for java.awt.CheckboxMenuItem.getListeners(java.lang.Class) definition code for java.awt.CheckboxMenuItem.getListeners(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class <T> listenerType)
          Returns an array of all the objects currently registered as FooListeners upon this CheckboxMenuItem.
 Object sample code for java.lang.Object definition code for java.lang.Object [] getSelectedObjects sample code for java.awt.CheckboxMenuItem.getSelectedObjects() definition code for java.awt.CheckboxMenuItem.getSelectedObjects() ()
          Returns the an array (length 1) containing the checkbox menu item label or null if the checkbox is not selected.
 boolean getState sample code for java.awt.CheckboxMenuItem.getState() definition code for java.awt.CheckboxMenuItem.getState() ()
          Determines whether the state of this check box menu item is "on" or "off."
 String sample code for java.lang.String definition code for java.lang.String paramString sample code for java.awt.CheckboxMenuItem.paramString() definition code for java.awt.CheckboxMenuItem.paramString() ()
          Returns a string representing the state of this CheckBoxMenuItem.
protected  void processEvent sample code for java.awt.CheckboxMenuItem.processEvent(java.awt.AWTEvent) definition code for java.awt.CheckboxMenuItem.processEvent(java.awt.AWTEvent) (AWTEvent sample code for java.awt.AWTEvent definition code for java.awt.AWTEvent  e)
          Processes events on this check box menu item.
protected  void processItemEvent sample code for java.awt.CheckboxMenuItem.processItemEvent(java.awt.event.ItemEvent) definition code for java.awt.CheckboxMenuItem.processItemEvent(java.awt.event.ItemEvent) (ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent  e)
          Processes item events occurring on this check box menu item by dispatching them to any registered ItemListener objects.
 void removeItemListener sample code for java.awt.CheckboxMenuItem.removeItemListener(java.awt.event.ItemListener) definition code for java.awt.CheckboxMenuItem.removeItemListener(java.awt.event.ItemListener) (ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener  l)
          Removes the specified item listener so that it no longer receives item events from this check box menu item.
 void setState sample code for java.awt.CheckboxMenuItem.setState(boolean) definition code for java.awt.CheckboxMenuItem.setState(boolean) (boolean b)
          Sets this check box menu item to the specifed state.
 
Methods inherited from class java.awt.MenuItem sample code for java.awt.MenuItem definition code for java.awt.MenuItem
addActionListener sample code for java.awt.MenuItem.addActionListener(java.awt.event.ActionListener) definition code for java.awt.MenuItem.addActionListener(java.awt.event.ActionListener) , deleteShortcut sample code for java.awt.MenuItem.deleteShortcut() definition code for java.awt.MenuItem.deleteShortcut() , disable sample code for java.awt.MenuItem.disable() definition code for java.awt.MenuItem.disable() , disableEvents sample code for java.awt.MenuItem.disableEvents(long) definition code for java.awt.MenuItem.disableEvents(long) , enable sample code for java.awt.MenuItem.enable() definition code for java.awt.MenuItem.enable() , enable sample code for java.awt.MenuItem.enable(boolean) definition code for java.awt.MenuItem.enable(boolean) , enableEvents sample code for java.awt.MenuItem.enableEvents(long) definition code for java.awt.MenuItem.enableEvents(long) , getActionCommand sample code for java.awt.MenuItem.getActionCommand() definition code for java.awt.MenuItem.getActionCommand() , getActionListeners sample code for java.awt.MenuItem.getActionListeners() definition code for java.awt.MenuItem.getActionListeners() , getLabel sample code for java.awt.MenuItem.getLabel() definition code for java.awt.MenuItem.getLabel() , getShortcut sample code for java.awt.MenuItem.getShortcut() definition code for java.awt.MenuItem.getShortcut() , isEnabled sample code for java.awt.MenuItem.isEnabled() definition code for java.awt.MenuItem.isEnabled() , processActionEvent sample code for java.awt.MenuItem.processActionEvent(java.awt.event.ActionEvent) definition code for java.awt.MenuItem.processActionEvent(java.awt.event.ActionEvent) , removeActionListener sample code for java.awt.MenuItem.removeActionListener(java.awt.event.ActionListener) definition code for java.awt.MenuItem.removeActionListener(java.awt.event.ActionListener) , setActionCommand sample code for java.awt.MenuItem.setActionCommand(java.lang.String) definition code for java.awt.MenuItem.setActionCommand(java.lang.String) , setEnabled sample code for java.awt.MenuItem.setEnabled(boolean) definition code for java.awt.MenuItem.setEnabled(boolean) , setLabel sample code for java.awt.MenuItem.setLabel(java.lang.String) definition code for java.awt.MenuItem.setLabel(java.lang.String) , setShortcut sample code for java.awt.MenuItem.setShortcut(java.awt.MenuShortcut) definition code for java.awt.MenuItem.setShortcut(java.awt.MenuShortcut)
 
Methods inherited from class java.awt.MenuComponent sample code for java.awt.MenuComponent definition code for java.awt.MenuComponent
dispatchEvent sample code for java.awt.MenuComponent.dispatchEvent(java.awt.AWTEvent) definition code for java.awt.MenuComponent.dispatchEvent(java.awt.AWTEvent) , getFont sample code for java.awt.MenuComponent.getFont() definition code for java.awt.MenuComponent.getFont() , getName sample code for java.awt.MenuComponent.getName() definition code for java.awt.MenuComponent.getName() , getParent sample code for java.awt.MenuComponent.getParent() definition code for java.awt.MenuComponent.getParent() , getPeer sample code for java.awt.MenuComponent.getPeer() definition code for java.awt.MenuComponent.getPeer() , getTreeLock sample code for java.awt.MenuComponent.getTreeLock() definition code for java.awt.MenuComponent.getTreeLock() , postEvent sample code for java.awt.MenuComponent.postEvent(java.awt.Event) definition code for java.awt.MenuComponent.postEvent(java.awt.Event) , removeNotify sample code for java.awt.MenuComponent.removeNotify() definition code for java.awt.MenuComponent.removeNotify() , setFont sample code for java.awt.MenuComponent.setFont(java.awt.Font) definition code for java.awt.MenuComponent.setFont(java.awt.Font) , setName sample code for java.awt.MenuComponent.setName(java.lang.String) definition code for java.awt.MenuComponent.setName(java.lang.String) , toString sample code for java.awt.MenuComponent.toString() definition code for java.awt.MenuComponent.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

CheckboxMenuItem sample code for java.awt.CheckboxMenuItem() definition code for java.awt.CheckboxMenuItem()

public CheckboxMenuItem()
                 throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Create a check box menu item with an empty label. The item's state is initially set to "off."

Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true
Since:
JDK1.1
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

CheckboxMenuItem sample code for java.awt.CheckboxMenuItem(java.lang.String) definition code for java.awt.CheckboxMenuItem(java.lang.String)

public CheckboxMenuItem(String sample code for java.lang.String definition code for java.lang.String  label)
                 throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Create a check box menu item with the specified label. The item's state is initially set to "off."

Parameters:
label - a string label for the check box menu item, or null for an unlabeled menu item.
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

CheckboxMenuItem sample code for java.awt.CheckboxMenuItem(java.lang.String, boolean) definition code for java.awt.CheckboxMenuItem(java.lang.String, boolean)

public CheckboxMenuItem(String sample code for java.lang.String definition code for java.lang.String  label,
                        boolean state)
                 throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Create a check box menu item with the specified label and state.

Parameters:
label - a string label for the check box menu item, or null for an unlabeled menu item.
state - the initial state of the menu item, where true indicates "on" and false indicates "off."
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true
Since:
JDK1.1
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()
Method Detail

addNotify sample code for java.awt.CheckboxMenuItem.addNotify() definition code for java.awt.CheckboxMenuItem.addNotify()

public void addNotify()
Creates the peer of the checkbox item. This peer allows us to change the look of the checkbox item without changing its functionality. Most applications do not call this method directly.

Overrides:
addNotify sample code for java.awt.MenuItem.addNotify() definition code for java.awt.MenuItem.addNotify() in class MenuItem sample code for java.awt.MenuItem definition code for java.awt.MenuItem
See Also:
Toolkit.createCheckboxMenuItem(java.awt.CheckboxMenuItem) sample code for java.awt.Toolkit.createCheckboxMenuItem(java.awt.CheckboxMenuItem) definition code for java.awt.Toolkit.createCheckboxMenuItem(java.awt.CheckboxMenuItem) , Component.getToolkit() sample code for java.awt.Component.getToolkit() definition code for java.awt.Component.getToolkit()

getState sample code for java.awt.CheckboxMenuItem.getState() definition code for java.awt.CheckboxMenuItem.getState()

public boolean getState()
Determines whether the state of this check box menu item is "on" or "off."

Returns:
the state of this check box menu item, where true indicates "on" and false indicates "off"
See Also:
setState(boolean) sample code for java.awt.CheckboxMenuItem.setState(boolean) definition code for java.awt.CheckboxMenuItem.setState(boolean)

setState sample code for java.awt.CheckboxMenuItem.setState(boolean) definition code for java.awt.CheckboxMenuItem.setState(boolean)

public void setState(boolean b)
Sets this check box menu item to the specifed state. The boolean value true indicates "on" while false indicates "off."

Note that this method should be primarily used to initialize the state of the check box menu item. Programmatically setting the state of the check box menu item will not trigger an ItemEvent. The only way to trigger an ItemEvent is by user interaction.

Parameters:
b - true if the check box menu item is on, otherwise false
See Also:
getState() sample code for java.awt.CheckboxMenuItem.getState() definition code for java.awt.CheckboxMenuItem.getState()

getSelectedObjects sample code for java.awt.CheckboxMenuItem.getSelectedObjects() definition code for java.awt.CheckboxMenuItem.getSelectedObjects()

public Object sample code for java.lang.Object definition code for java.lang.Object [] getSelectedObjects()
Returns the an array (length 1) containing the checkbox menu item label or null if the checkbox is not selected.

Specified by:
getSelectedObjects sample code for java.awt.ItemSelectable.getSelectedObjects() definition code for java.awt.ItemSelectable.getSelectedObjects() in interface ItemSelectable sample code for java.awt.ItemSelectable definition code for java.awt.ItemSelectable
See Also:
ItemSelectable sample code for java.awt.ItemSelectable definition code for java.awt.ItemSelectable

addItemListener sample code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener) definition code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener)

public void addItemListener(ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener  l)
Adds the specified item listener to receive item events from this check box menu item. Item events are sent in response to user actions, but not in response to calls to setState(). If l is null, no exception is thrown and no action is performed.

Specified by:
addItemListener sample code for java.awt.ItemSelectable.addItemListener(java.awt.event.ItemListener) definition code for java.awt.ItemSelectable.addItemListener(java.awt.event.ItemListener) in interface ItemSelectable sample code for java.awt.ItemSelectable definition code for java.awt.ItemSelectable
Parameters:
l - the item listener
Since:
JDK1.1
See Also:
removeItemListener(java.awt.event.ItemListener) sample code for java.awt.CheckboxMenuItem.removeItemListener(java.awt.event.ItemListener) definition code for java.awt.CheckboxMenuItem.removeItemListener(java.awt.event.ItemListener) , getItemListeners() sample code for java.awt.CheckboxMenuItem.getItemListeners() definition code for java.awt.CheckboxMenuItem.getItemListeners() , setState(boolean) sample code for java.awt.CheckboxMenuItem.setState(boolean) definition code for java.awt.CheckboxMenuItem.setState(boolean) , ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent , ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener

removeItemListener sample code for java.awt.CheckboxMenuItem.removeItemListener(java.awt.event.ItemListener) definition code for java.awt.CheckboxMenuItem.removeItemListener(java.awt.event.ItemListener)

public void removeItemListener(ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener  l)
Removes the specified item listener so that it no longer receives item events from this check box menu item. If l is null, no exception is thrown and no action is performed.

Specified by:
removeItemListener sample code for java.awt.ItemSelectable.removeItemListener(java.awt.event.ItemListener) definition code for java.awt.ItemSelectable.removeItemListener(java.awt.event.ItemListener) in interface ItemSelectable sample code for java.awt.ItemSelectable definition code for java.awt.ItemSelectable
Parameters:
l - the item listener
Since:
JDK1.1
See Also:
addItemListener(java.awt.event.ItemListener) sample code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener) definition code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener) , getItemListeners() sample code for java.awt.CheckboxMenuItem.getItemListeners() definition code for java.awt.CheckboxMenuItem.getItemListeners() , ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent , ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener

getItemListeners sample code for java.awt.CheckboxMenuItem.getItemListeners() definition code for java.awt.CheckboxMenuItem.getItemListeners()

public ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener [] getItemListeners()
Returns an array of all the item listeners registered on this checkbox menuitem.

Returns:
all of this checkbox menuitem's ItemListeners or an empty array if no item listeners are currently registered
Since:
1.4
See Also:
addItemListener(java.awt.event.ItemListener) sample code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener) definition code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener) , removeItemListener(java.awt.event.ItemListener) sample code for java.awt.CheckboxMenuItem.removeItemListener(java.awt.event.ItemListener) definition code for java.awt.CheckboxMenuItem.removeItemListener(java.awt.event.ItemListener) , ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent , ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener

getListeners sample code for java.awt.CheckboxMenuItem.<T extends java.util.EventListener>getListeners(java.lang.Class<T>) definition code for java.awt.CheckboxMenuItem.<T extends java.util.EventListener>getListeners(java.lang.Class<T>)

public <T extends EventListener sample code for java.util.EventListener definition code for java.util.EventListener > T[] getListeners(Class sample code for java.lang.Class definition code for java.lang.Class <T> listenerType)
Returns an array of all the objects currently registered as FooListeners upon this CheckboxMenuItem. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a CheckboxMenuItem c for its item listeners with the following code:

ItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));
If no such listeners exist, this method returns an empty array.

Overrides:
getListeners sample code for java.awt.MenuItem.getListeners(java.lang.Class) definition code for java.awt.MenuItem.getListeners(java.lang.Class) in class MenuItem sample code for java.awt.MenuItem definition code for java.awt.MenuItem
Parameters:
listenerType - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
Returns:
an array of all objects registered as FooListeners on this checkbox menuitem, or an empty array if no such listeners have been added
Throws:
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
Since:
1.3
See Also:
getItemListeners() sample code for java.awt.CheckboxMenuItem.getItemListeners() definition code for java.awt.CheckboxMenuItem.getItemListeners()

processEvent sample code for java.awt.CheckboxMenuItem.processEvent(java.awt.AWTEvent) definition code for java.awt.CheckboxMenuItem.processEvent(java.awt.AWTEvent)

protected void processEvent(AWTEvent sample code for java.awt.AWTEvent definition code for java.awt.AWTEvent  e)
Processes events on this check box menu item. If the event is an instance of ItemEvent, this method invokes the processItemEvent method. If the event is not an item event, it invokes processEvent on the superclass.

Check box menu items currently support only item events.

Note that if the event parameter is null the behavior is unspecified and may result in an exception.

Overrides:
processEvent sample code for java.awt.MenuItem.processEvent(java.awt.AWTEvent) definition code for java.awt.MenuItem.processEvent(java.awt.AWTEvent) in class MenuItem sample code for java.awt.MenuItem definition code for java.awt.MenuItem
Parameters:
e - the event
Since:
JDK1.1
See Also:
ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent , processItemEvent(java.awt.event.ItemEvent) sample code for java.awt.CheckboxMenuItem.processItemEvent(java.awt.event.ItemEvent) definition code for java.awt.CheckboxMenuItem.processItemEvent(java.awt.event.ItemEvent)

processItemEvent sample code for java.awt.CheckboxMenuItem.processItemEvent(java.awt.event.ItemEvent) definition code for java.awt.CheckboxMenuItem.processItemEvent(java.awt.event.ItemEvent)

protected void processItemEvent(ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent  e)
Processes item events occurring on this check box menu item by dispatching them to any registered ItemListener objects.

This method is not called unless item events are enabled for this menu item. Item events are enabled when one of the following occurs:

Note that if the event parameter is null the behavior is unspecified and may result in an exception.

Parameters:
e - the item event
Since:
JDK1.1
See Also:
ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent , ItemListener sample code for java.awt.event.ItemListener definition code for java.awt.event.ItemListener , addItemListener(java.awt.event.ItemListener) sample code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener) definition code for java.awt.CheckboxMenuItem.addItemListener(java.awt.event.ItemListener) , MenuItem.enableEvents(long) sample code for java.awt.MenuItem.enableEvents(long) definition code for java.awt.MenuItem.enableEvents(long)

paramString sample code for java.awt.CheckboxMenuItem.paramString() definition code for java.awt.CheckboxMenuItem.paramString()

public String sample code for java.lang.String definition code for java.lang.String  paramString()
Returns a string representing the state of this CheckBoxMenuItem. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString sample code for java.awt.MenuItem.paramString() definition code for java.awt.MenuItem.paramString() in class MenuItem sample code for java.awt.MenuItem definition code for java.awt.MenuItem
Returns:
the parameter string of this check box menu item

getAccessibleContext sample code for java.awt.CheckboxMenuItem.getAccessibleContext() definition code for java.awt.CheckboxMenuItem.getAccessibleContext()

public AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext  getAccessibleContext()
Gets the AccessibleContext associated with this CheckboxMenuItem. For checkbox menu items, the AccessibleContext takes the form of an AccessibleAWTCheckboxMenuItem. A new AccessibleAWTCheckboxMenuItem is created if necessary.

Specified by:
getAccessibleContext sample code for javax.accessibility.Accessible.getAccessibleContext() definition code for javax.accessibility.Accessible.getAccessibleContext() in interface Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible
Overrides:
getAccessibleContext sample code for java.awt.MenuItem.getAccessibleContext() definition code for java.awt.MenuItem.getAccessibleContext() in class MenuItem sample code for java.awt.MenuItem definition code for java.awt.MenuItem
Returns:
an AccessibleAWTCheckboxMenuItem that serves as the AccessibleContext of this CheckboxMenuItem