public class DefaultComboBoxModel extends AbstractListModel implements MutableComboBoxModel
_listeners
Constructor and Description |
---|
DefaultComboBoxModel()
Default constructor
|
DefaultComboBoxModel(java.lang.Object[] items_)
Constructs a DefaultComboBoxModel object initialized with an array
of objects.
|
DefaultComboBoxModel(java.util.Vector items_)
Constructs a DefaultComboBoxModel object initialized with a vector.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(java.lang.Object obj_)
Add the specified object to the end of the list.
|
boolean |
contains(java.lang.Object elem_)
Returns true if the specified element is in the list.
|
java.lang.Object |
getElementAt(int index_)
Returns the value at the specified index.
|
java.lang.Object |
getSelectedItem()
Return the selected item.
|
int |
getSize()
Returns the length of the list.
|
int |
indexOf(java.lang.Object elem_)
Returns the index of the first occurrence of the specified object.
|
void |
insertElementAt(java.lang.Object obj_,
int index_)
Insert an item at the specified index.
|
void |
removeAllElements()
Removes all elements from this list and sets its size to zero.
|
void |
removeElement(java.lang.Object obj_)
Remove the specified object from the model.
|
void |
removeElementAt(int index_)
Deletes the component at the specified index.
|
void |
setSelectedItem(java.lang.Object anItem_)
Set the selected item
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, removeListDataListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListDataListener, removeListDataListener
public DefaultComboBoxModel()
public DefaultComboBoxModel(java.util.Vector items_)
public DefaultComboBoxModel(java.lang.Object[] items_)
public java.lang.Object getElementAt(int index_)
getElementAt
in interface ListModel
public int getSize()
public boolean contains(java.lang.Object elem_)
public int indexOf(java.lang.Object elem_)
public java.lang.Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel
public void setSelectedItem(java.lang.Object anItem_)
setSelectedItem
in interface ComboBoxModel
public void addElement(java.lang.Object obj_)
addElement
in interface MutableComboBoxModel
public void removeElementAt(int index_)
removeElementAt
in interface MutableComboBoxModel
public void removeAllElements()
public void insertElementAt(java.lang.Object obj_, int index_)
insertElementAt
in interface MutableComboBoxModel
public void removeElement(java.lang.Object obj_)
removeElement
in interface MutableComboBoxModel