public class ExtendedComboBoxModel extends AbstractListModel implements MutableComboBoxModel, Serializable
listenerList
Constructor and Description |
---|
ExtendedComboBoxModel()
Constructs an empty DefaultComboBoxModel object.
|
ExtendedComboBoxModel(Object[] items)
Constructs a DefaultComboBoxModel object initialized with an array of
objects.
|
ExtendedComboBoxModel(Vector<?> v)
Constructs a DefaultComboBoxModel object initialized with a vector.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(Object anObject) |
Object |
getElementAt(int index) |
int |
getIndexOf(Object anObject)
Returns the index-position of the specified object in the list.
|
Object |
getSelectedItem() |
int |
getSize() |
void |
insertElementAt(Object anObject,
int index) |
void |
removeAllElements()
Empties the list.
|
void |
removeElement(Object anObject) |
void |
removeElementAt(int index) |
void |
setElementAt(Object obj,
int index) |
void |
setSelectedItem(Object anObject)
Set the value of the selected item.
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListDataListener, removeListDataListener
public ExtendedComboBoxModel()
public ExtendedComboBoxModel(Object[] items)
items
- an array of Object objectspublic ExtendedComboBoxModel(Vector<?> v)
v
- a Vector object ...public void setSelectedItem(Object anObject)
setSelectedItem
in interface ComboBoxModel
anObject
- The combo box value or null for no selection.public Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel
public Object getElementAt(int index)
getElementAt
in interface ListModel
public int getIndexOf(Object anObject)
anObject
- public void addElement(Object anObject)
addElement
in interface MutableComboBoxModel
public void insertElementAt(Object anObject, int index)
insertElementAt
in interface MutableComboBoxModel
public void removeElementAt(int index)
removeElementAt
in interface MutableComboBoxModel
public void removeElement(Object anObject)
removeElement
in interface MutableComboBoxModel
public void removeAllElements()
public void setElementAt(Object obj, int index)
Copyright © 2019. All Rights Reserved.