public class DefaultListComboBoxModel
extends javax.swing.AbstractListModel
implements javax.swing.MutableComboBoxModel, java.io.Serializable
| Constructor and Description |
|---|
DefaultListComboBoxModel()
Constructs an empty DefaultComboBoxModel object.
|
DefaultListComboBoxModel(java.util.List v)
Constructs a DefaultComboBoxModel object initialized with
a list.
|
DefaultListComboBoxModel(java.lang.Object[] items)
Constructs a DefaultComboBoxModel object initialized with
an array of objects.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(java.lang.Object anObject) |
java.lang.Object |
getElementAt(int index) |
int |
getIndexOf(java.lang.Object anObject)
Returns the index-position of the specified object in the list.
|
java.lang.Object |
getSelectedItem() |
int |
getSize() |
void |
insertElementAt(java.lang.Object anObject,
int index) |
void |
removeAllElements()
Empties the list.
|
void |
removeElement(java.lang.Object anObject) |
void |
removeElementAt(int index) |
void |
setSelectedItem(java.lang.Object anObject) |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerpublic DefaultListComboBoxModel()
public DefaultListComboBoxModel(java.lang.Object[] items)
items - an array of Object objectspublic DefaultListComboBoxModel(java.util.List v)
v - a List object ...public void setSelectedItem(java.lang.Object anObject)
setSelectedItem in interface javax.swing.ComboBoxModelpublic java.lang.Object getSelectedItem()
getSelectedItem in interface javax.swing.ComboBoxModelpublic int getSize()
getSize in interface javax.swing.ListModelpublic java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelpublic int getIndexOf(java.lang.Object anObject)
anObject - public void addElement(java.lang.Object anObject)
addElement in interface javax.swing.MutableComboBoxModelpublic void insertElementAt(java.lang.Object anObject,
int index)
insertElementAt in interface javax.swing.MutableComboBoxModelpublic void removeElementAt(int index)
removeElementAt in interface javax.swing.MutableComboBoxModelpublic void removeElement(java.lang.Object anObject)
removeElement in interface javax.swing.MutableComboBoxModelpublic void removeAllElements()