E - the type of elements maintained by the list backing this modelpublic class ListComboBoxModel<E> extends AbstractListModel implements ComboBoxModel, ActionListener
ComboBoxModel for Lists.| 限定符和类型 | 字段和说明 |
|---|---|
protected List<E> |
data
A reference to the list backing this model.
|
protected E |
selected
The currently selected item.
|
static String |
UPDATE
A key used to notify the model that the backing
List has changed. |
listenerList| 构造器和说明 |
|---|
ListComboBoxModel(List<E> list)
Creates a
ListComboBoxModel backed by the supplied list. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
actionPerformed(ActionEvent evt) |
E |
getElementAt(int index) |
E |
getSelectedItem() |
int |
getSize() |
void |
setSelectedItem(Object item)
Set the selected item.
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListDataListener, removeListDataListenerpublic static final String UPDATE
List has changed.protected final List<E> data
This model does not make a copy of the list, so any changes in the list without synchronizing the model may have drastic effects.
protected E selected
public ListComboBoxModel(List<E> list)
ListComboBoxModel backed by the supplied list.list - the list backing this modelNullPointerException - if list is nullpublic void setSelectedItem(Object item)
ListDataListeners that the contents have changed.setSelectedItem 在接口中 ComboBoxModelitem - the list object to select or null to clear the
selectionClassCastException - if item is not of type Epublic E getSelectedItem()
getSelectedItem 在接口中 ComboBoxModelpublic E getElementAt(int index)
getElementAt 在接口中 ListModelpublic void actionPerformed(ActionEvent evt)
actionPerformed 在接口中 ActionListenerCopyright © 2021. All rights reserved.