[Chapter 19] ItemSelectable

#

| Chapter 19 java.awt Reference |

# ItemSelectable

## Name

ItemSelectable

##

## 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 `Object`s 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`

Insets |  | Label