|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractListModel
javax.swing.DefaultComboBoxModel
public class DefaultComboBoxModel
The default model for combo boxes.
| Field Summary |
|---|
| 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 at 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()
Returns 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 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 |
| 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 ComboBoxModelanObject - The combo box value or null for no selection.public Object getSelectedItem()
ComboBoxModel
getSelectedItem in interface ComboBoxModelnull if there is no selectionpublic int getSize()
ListModel
getSize in interface ListModelpublic Object getElementAt(int index)
ListModel
getElementAt in interface ListModelindex - the requested index
indexpublic int getIndexOf(Object anObject)
anObject -
public void addElement(Object anObject)
MutableComboBoxModelListDataListeners that the
item has been added.
addElement in interface MutableComboBoxModelanObject - the Object to be added
public void insertElementAt(Object anObject,
int index)
MutableComboBoxModelListDataListeners that the
item has been added.
insertElementAt in interface MutableComboBoxModelanObject - the Object to be addedindex - location to add the objectpublic void removeElementAt(int index)
MutableComboBoxModelListDataListeners that the
item has been removed.
removeElementAt in interface MutableComboBoxModelindex - location of object to be removedpublic void removeElement(Object anObject)
MutableComboBoxModelListDataListeners that the
item has been removed.
removeElement in interface MutableComboBoxModelanObject - the Object to be removedpublic void removeAllElements()
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.