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, removeListDataListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListDataListener, removeListDataListenerpublic 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 ComboBoxModelanObject - The combo box value or null for no selection.public Object getSelectedItem()
getSelectedItem in interface ComboBoxModelpublic Object getElementAt(int index)
getElementAt in interface ListModelpublic int getIndexOf(Object anObject)
anObject - public void addElement(Object anObject)
addElement in interface MutableComboBoxModelpublic void insertElementAt(Object anObject, int index)
insertElementAt in interface MutableComboBoxModelpublic void removeElementAt(int index)
removeElementAt in interface MutableComboBoxModelpublic void removeElement(Object anObject)
removeElement in interface MutableComboBoxModelpublic void removeAllElements()
public void setElementAt(Object obj, int index)
Copyright © 2019. All Rights Reserved.