charvax.swing
Class DefaultComboBoxModel
- ComboBoxModel, ListModel, MutableComboBoxModel
public class DefaultComboBoxModel
The default model for combo boxes.
void | addElement(Object obj_) - Add the specified object to the end of the list.
|
boolean | contains(Object elem_) - Returns true if the specified element is in the list.
|
Object | getElementAt(int index_) - Returns the value at the specified index.
|
Object | getSelectedItem() - Return the selected item.
|
int | getSize() - Returns the length of the list.
|
int | indexOf(Object elem_) - Returns the index of the first occurrence of the specified object.
|
void | insertElementAt(Object obj_, int index_) - Insert an item at the specified index.
|
void | removeAllElements() - Removes all elements from this list and sets its size to zero.
|
void | removeElement(Object obj_) - Remove the specified object from the model.
|
void | removeElementAt(int index_) - Deletes the component at the specified index.
|
void | setSelectedItem(Object anItem_) - Set the selected item
|
DefaultComboBoxModel
public DefaultComboBoxModel()
Default constructor
DefaultComboBoxModel
public DefaultComboBoxModel(Object[] items_)
Constructs a DefaultComboBoxModel object initialized with an array
of objects.
DefaultComboBoxModel
public DefaultComboBoxModel(Vector items_)
Constructs a DefaultComboBoxModel object initialized with a vector.
contains
public boolean contains(Object elem_)
Returns true if the specified element is in the list.
getElementAt
public Object getElementAt(int index_)
Returns the value at the specified index.
- getElementAt in interface ListModel
getSize
public int getSize()
Returns the length of the list.
- getSize in interface ListModel
indexOf
public int indexOf(Object elem_)
Returns the index of the first occurrence of the specified object.
removeAllElements
public void removeAllElements()
Removes all elements from this list and sets its size to zero.