|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractListModel | +--javax.swing.DefaultComboBoxModel
The default model for combo boxes.
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Constructor Summary | |
DefaultComboBoxModel()
Constructs an empty DefaultComboBoxModel object. |
|
DefaultComboBoxModel(Object[] items)
Constructs a DefaultComboBoxModel object initialized with an array of objects. |
|
DefaultComboBoxModel(Vector v)
Constructs a DefaultComboBoxModel object initialized with a vector. |
Method Summary | |
void |
addElement(Object anObject)
Adds an item to the end of the model. |
Object |
getElementAt(int index)
Returns the value at the specified index. |
int |
getIndexOf(Object anObject)
Returns the index-position of the specified object in the list. |
Object |
getSelectedItem()
Return the selected item |
int |
getSize()
Returns the length of the list. |
void |
insertElementAt(Object anObject,
int index)
Adds an item at a specific index |
void |
removeAllElements()
Empties the list. |
void |
removeElement(Object anObject)
Removes an item from the model. |
void |
removeElementAt(int index)
Removes an item at a specific index |
void |
setSelectedItem(Object anObject)
Set the selected item |
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.ListModel |
addListDataListener, removeListDataListener |
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 setSelectedItem(Object anObject)
ComboBoxModel
setSelectedItem
in interface ComboBoxModel
public Object getSelectedItem()
ComboBoxModel
getSelectedItem
in interface ComboBoxModel
public int getSize()
ListModel
getSize
in interface ListModel
public Object getElementAt(int index)
ListModel
getElementAt
in interface ListModel
public int getIndexOf(Object anObject)
anObject
- public void addElement(Object anObject)
MutableComboBoxModel
addElement
in interface MutableComboBoxModel
javax.swing.MutableComboBoxModel
obj
- the Object
to be addedpublic void insertElementAt(Object anObject, int index)
MutableComboBoxModel
insertElementAt
in interface MutableComboBoxModel
javax.swing.MutableComboBoxModel
obj
- the Object
to be addedindex
- location to add the objectpublic void removeElementAt(int index)
MutableComboBoxModel
removeElementAt
in interface MutableComboBoxModel
javax.swing.MutableComboBoxModel
index
- location of object to be removedpublic void removeElement(Object anObject)
MutableComboBoxModel
removeElement
in interface MutableComboBoxModel
javax.swing.MutableComboBoxModel
obj
- the Object
to be removedpublic void removeAllElements()
|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.