APIdia Launch Partner
Top Description Methods
javax.swing

public Interface ComboBoxModel<E>

extends ListModel<E>
Known Direct Subinterfaces
javax.swing.MutableComboBoxModel
Known Direct Implementers
javax.swing.plaf.metal.MetalFileChooserUI.DirectoryComboBoxModel, javax.swing.plaf.metal.MetalFileChooserUI.FilterComboBoxModel, com.sun.java.swing.plaf.gtk.GTKFileChooserUI.DirectoryComboBoxModel, com.sun.java.swing.plaf.gtk.GTKFileChooserUI.FilterComboBoxModel, com.sun.java.swing.plaf.motif.MotifFileChooserUI.FilterComboBoxModel, sun.swing.plaf.synth.SynthFileChooserUIImpl.DirectoryComboBoxModel, sun.swing.plaf.synth.SynthFileChooserUIImpl.FilterComboBoxModel
Type Parameters
<E>
the type of the elements of this model

A data model for a combo box. This interface extends ListModel and adds the concept of a selected item. The selected item is generally the item which is visible in the combo box display area.

The selected item may not necessarily be managed by the underlying ListModel. This disjoint behavior allows for the temporary storage and retrieval of a selected item in the model.

Author
Arnaud Weber
Since
1.2

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

The selected item or null if there is no selection
getSelectedItem
()

Returns the selected item

public void
setSelectedItem(Object
the list object to select or null to clear the selection
anItem
)

Set the selected item.

Inherited from javax.swing.ListModel:
addListDataListenergetElementAtgetSizeremoveListDataListener

Method Detail

getSelectedItemback to summary
public Object getSelectedItem()

Returns the selected item

Returns:Object

The selected item or null if there is no selection

setSelectedItemback to summary
public void setSelectedItem(Object anItem)

Set the selected item. The implementation of this method should notify all registered ListDataListeners that the contents have changed.

Parameters
anItem:Object

the list object to select or null to clear the selection