javax.swing
public interface ComboBoxModel extends ListModel
JComboBox
. This model keeps track of elements
contained in the JComboBox
as well as the current
combo box selection. Whenever the selection in the JComboBox
changes, the ComboBoxModel
should fire a ListDataEvent
to the model's ListDataListener
s.Modifier and Type | Method and Description |
---|---|
Object |
getSelectedItem()
Returns the currently selected item in the combo box.
|
void |
setSelectedItem(Object item)
Sets the selected item in the combo box.
|
addListDataListener, getElementAt, getSize, removeListDataListener
void setSelectedItem(Object item)
ListDataEvent
to all registered
ListDataListener
s to indicate that the selection has changed.item
- the selected item (null
permitted).Object getSelectedItem()
null
).