| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
DefaultComboBoxModel model = new DefaultComboBoxModel();
Based on 41 examples
public class DefaultComboBoxModel extends AbstractListModel implements MutableComboBoxModel, Serializable
The default model for combo boxes.
Field Summary |
---|
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
Constructs an empty DefaultComboBoxModel object. |
|
DefaultComboBoxModel(Object[] items) Constructs a DefaultComboBoxModel object initialized with an array of objects. |
|
Constructs a DefaultComboBoxModel object initialized with a vector. |
Method Summary | |
---|---|
void |
addElement(Object anObject) |
Object |
getElementAt(int index) |
int |
getIndexOf(Object anObject) Returns the index-position of the specified object in the list. |
Object |
|
int |
getSize() |
void |
insertElementAt(Object anObject, int index) |
void |
Empties the list. |
void |
removeElement(Object anObject) |
void |
removeElementAt(int index) |
void |
setSelectedItem(Object anObject) Set the value of the selected item. |
Methods inherited from class javax.swing.AbstractListModel |
---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultComboBoxModel()
public DefaultComboBoxModel(Object[] items)
items
- an array of Object objectspublic DefaultComboBoxModel(Vector v)
v
- a Vector object ...Method Detail |
---|
public void addElement(Object anObject)
anObject
public Object getElementAt(int index)
index
public int getIndexOf(Object anObject)
anObject
public Object getSelectedItem()
public int getSize()
public void insertElementAt(Object anObject, int index)
anObject
index
public void removeAllElements()
public void removeElement(Object anObject)
anObject
public void removeElementAt(int index)
index
public void setSelectedItem(Object anObject)
anObject
- The combo box value or null for no selection.
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |