|
||||||||||
| 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
, ComboBoxModel
, ListModel
, MutableComboBoxModel

public class DefaultComboBoxModel

, Serializable

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
Constructs a DefaultComboBoxModel object initialized with an array of objects. |
|
DefaultComboBoxModel
Constructs a DefaultComboBoxModel object initialized with a vector. |
|
| Method Summary | |
|---|---|
void |
addElement
Adds an item at the end of the model. |
Object |
getElementAt
Returns the value at the specified index. |
int |
getIndexOf
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
Adds an item at a specific index. |
void |
removeAllElements
Empties the list. |
void |
removeElement
Removes an item from the model. |
void |
removeElementAt
Removes an item at a specific index. |
void |
setSelectedItem
Set the value of the selected item. |
Methods inherited from class javax.swing.AbstractListModel ![]() |
|---|
addListDataListener |
Methods inherited from class java.lang.Object ![]() |
|---|
clone |
Methods inherited from interface javax.swing.ListModel ![]() |
|---|
addListDataListener |
| Constructor Detail |
|---|

public DefaultComboBoxModel()

public DefaultComboBoxModel(Object![]()
![]()
[] items)
items - an array of Object objects

public 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()
ComboBoxModel

getSelectedItem

in interface ComboBoxModel

null if there is no selection

public int getSize()
ListModel

getSize

in interface ListModel


public Object![]()
![]()
getElementAt(int index)
ListModel

getElementAt

in interface ListModel

index - the requested index
index

public int getIndexOf(Object![]()
![]()
anObject)
anObject -

public void addElement(Object![]()
![]()
anObject)
MutableComboBoxModel

ListDataListeners that the
item has been added.
addElement

in interface MutableComboBoxModel

anObject - the Object to be added

public void insertElementAt(Object![]()
![]()
anObject, int index)
MutableComboBoxModel

ListDataListeners that the
item has been added.
insertElementAt

in interface MutableComboBoxModel

anObject - the Object to be addedindex - location to add the object

public void removeElementAt(int index)
MutableComboBoxModel

ListDataListeners that the
item has been removed.
removeElementAt

in interface MutableComboBoxModel

index - location of object to be removed

public void removeElement(Object![]()
![]()
anObject)
MutableComboBoxModel

ListDataListeners that the
item has been removed.
removeElement

in interface MutableComboBoxModel

anObject - the Object to be removed

public void removeAllElements()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||