java.awt.event
Interface ItemListener

All Superinterfaces:
EventListener sample code for java.util.EventListener definition code for java.util.EventListener
All Known Implementing Classes:
AWTEventMulticaster sample code for java.awt.AWTEventMulticaster definition code for java.awt.AWTEventMulticaster , BasicComboBoxUI.ItemHandler sample code for javax.swing.plaf.basic.BasicComboBoxUI.ItemHandler definition code for javax.swing.plaf.basic.BasicComboBoxUI.ItemHandler , BasicComboPopup.ItemHandler sample code for javax.swing.plaf.basic.BasicComboPopup.ItemHandler definition code for javax.swing.plaf.basic.BasicComboPopup.ItemHandler , Checkbox.AccessibleAWTCheckbox sample code for java.awt.Checkbox.AccessibleAWTCheckbox definition code for java.awt.Checkbox.AccessibleAWTCheckbox , DefaultCellEditor.EditorDelegate sample code for javax.swing.DefaultCellEditor.EditorDelegate definition code for javax.swing.DefaultCellEditor.EditorDelegate , JCheckBox.AccessibleJCheckBox sample code for javax.swing.JCheckBox.AccessibleJCheckBox definition code for javax.swing.JCheckBox.AccessibleJCheckBox , JRadioButton.AccessibleJRadioButton sample code for javax.swing.JRadioButton.AccessibleJRadioButton definition code for javax.swing.JRadioButton.AccessibleJRadioButton , JToggleButton.AccessibleJToggleButton sample code for javax.swing.JToggleButton.AccessibleJToggleButton definition code for javax.swing.JToggleButton.AccessibleJToggleButton , List.AccessibleAWTList sample code for java.awt.List.AccessibleAWTList definition code for java.awt.List.AccessibleAWTList

public interface ItemListener
extends EventListener sample code for java.util.EventListener definition code for java.util.EventListener

The listener interface for receiving item events. The class that is interested in processing an item event implements this interface. The object created with that class is then registered with a component using the component's addItemListener method. When an item-selection event occurs, the listener object's itemStateChanged method is invoked.

Since:
1.1
See Also:
ItemSelectable sample code for java.awt.ItemSelectable definition code for java.awt.ItemSelectable , ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent , Tutorial: Writing an Item Listener, Reference: The Java Class Libraries (update file)

Method Summary
 void itemStateChanged sample code for java.awt.event.ItemListener.itemStateChanged(java.awt.event.ItemEvent) definition code for java.awt.event.ItemListener.itemStateChanged(java.awt.event.ItemEvent) (ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent  e)
          Invoked when an item has been selected or deselected by the user.
 

Method Detail

itemStateChanged sample code for java.awt.event.ItemListener.itemStateChanged(java.awt.event.ItemEvent) definition code for java.awt.event.ItemListener.itemStateChanged(java.awt.event.ItemEvent)

void itemStateChanged(ItemEvent sample code for java.awt.event.ItemEvent definition code for java.awt.event.ItemEvent  e)
Invoked when an item has been selected or deselected by the user. The code written for this method performs the operations that need to occur when an item is selected (or deselected).