Java AWT

Previous Chapter 19
java.awt Reference
Next
 

ItemSelectable (New)

Name

ItemSelectable (New)

[Graphic: Figure from the text]

Description

An interface that describes an object that has one or more items that can be selected.

Interface Definition

public abstract interface ItemSelectable {
  // Instance Methods
  public abstract void addItemListener (ItemListener l);
  public abstract Object[] getSelectedObjects();
  public abstract void removeItemListener (ItemListener l);
}

Interface Methods

addItemListener

public abstract void addItemListener (ItemListener l)

Parameters

l

The listener to be added.

Description

Adds a listener for ItemEvent objects.

getSelectedObjects

public abstract Object[] getSelectedObjects()

Description

This method returns an array containing Objects representing the items that are currently selected. If no items are selected, null is returned.

removeItemListener

public abstract void removeItemListener (ItemListener l)

Parameters

l

The listener to be removed.

Description

Removes the specified ItemListener so it will not receive ItemEvent objects.

See Also

Checkbox, CheckboxMenuItem, Choice, ItemEvent, ItemListener, List


Previous Home Next
Insets Book Index Label

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java
This HTML Help has been published using the chm2web software.