|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractListModel | +--javax.swing.DefaultComboBoxModel
Safe: The default model for combo boxes.
Field Summary | |
(package private) Vector |
objects
|
(package private) Object |
selectedObject
|
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Constructor Summary | |
DefaultComboBoxModel()
Enabled: Constructs an empty DefaultComboBoxModel object. |
|
DefaultComboBoxModel(Object[] items)
Enabled: Constructs a DefaultComboBoxModel object initialized with an array of objects. |
|
DefaultComboBoxModel(Vector v)
Enabled: Constructs a DefaultComboBoxModel object initialized with a vector. |
Method Summary | |
void |
addElement(Object anObject)
Enabled: |
Object |
getElementAt(int index)
Enabled: |
int |
getIndexOf(Object anObject)
Enabled: Returns the index-position of the specified object in the list. |
Object |
getSelectedItem()
Enabled: |
int |
getSize()
Enabled: |
void |
insertElementAt(Object anObject,
int index)
Enabled: |
void |
removeAllElements()
Enabled: Empties the list. |
void |
removeElement(Object anObject)
Enabled: |
void |
removeElementAt(int index)
Enabled: |
void |
setSelectedItem(Object anObject)
Enabled: 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 |
Methods inherited from interface javax.swing.ListModel |
addListDataListener, removeListDataListener |
Field Detail |
Vector objects
Object selectedObject
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)
setSelectedItem
in interface ComboBoxModel
anObject
- The combo box value or null for no selection.public Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel
null
if there is no selectionpublic int getSize()
getSize
in interface ListModel
public Object getElementAt(int index)
getElementAt
in interface ListModel
index
- the requested index
index
public int getIndexOf(Object anObject)
anObject
-
public void addElement(Object anObject)
addElement
in interface MutableComboBoxModel
anObject
- the Object
to be addedpublic void insertElementAt(Object anObject, int index)
insertElementAt
in interface MutableComboBoxModel
anObject
- the Object
to be addedindex
- location to add the objectpublic void removeElementAt(int index)
removeElementAt
in interface MutableComboBoxModel
index
- location of object to be removedpublic void removeElement(Object anObject)
removeElement
in interface MutableComboBoxModel
anObject
- the Object
to be removedpublic void removeAllElements()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |