Class DefaultComboBoxModel<E>
java.lang.Object
javax.swing.AbstractListModel<E>
javax.swing.DefaultComboBoxModel<E>
- Type Parameters:
E
- the type of the elements of this model
- All Implemented Interfaces:
Serializable
,ComboBoxModel<E>
,ListModel<E>
,MutableComboBoxModel<E>
public class DefaultComboBoxModel<E>
extends AbstractListModel<E>
implements MutableComboBoxModel<E>, Serializable
The default model for combo boxes.
- Since:
- 1.2
-
Field Summary
Fields declared in class javax.swing.AbstractListModel
listenerList
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty DefaultComboBoxModel object.DefaultComboBoxModel
(E[] items) Constructs a DefaultComboBoxModel object initialized with an array of objects.Constructs a DefaultComboBoxModel object initialized with a vector. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(int index, Collection<? extends E> c) Adds all of the elements present in the collection, starting from the specified index.void
addAll
(Collection<? extends E> c) Adds all of the elements present in the collection.void
addElement
(E anObject) Adds an item at the end of the model.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.Returns the selected itemint
getSize()
Returns the length of the list.void
insertElementAt
(E anObject, int index) Adds an item at a specific index.void
Empties the list.void
removeElement
(Object anObject) Removes an item from the model.void