public class javax.swing
DefaultComboBoxModel


Show All Login
Java SE 6
  
Extends: AbstractListModel
Implements: MutableComboBoxModel, Serializable
Details
The default model for combo boxes.
version1.20 11/17/05

Constructors
public DefaultComboBoxModel()
Constructs an empty DefaultComboBoxModel object.
public DefaultComboBoxModel(Object[] items) Details
Constructs a DefaultComboBoxModel object initialized with an array of objects.
itemsan array of Object objects
public DefaultComboBoxModel(Vector v) Details
Constructs a DefaultComboBoxModel object initialized with a vector.
va Vector object ...

Methods
public void addElement(Object anObject)
public void insertElementAt(Object anObject, int index)
public void removeAllElements()
Empties the list.
public void removeElement(Object anObject)
public void removeElementAt(int index)

Properties
public Object getElementAt(int index)
public int getIndexOf(Object anObject) Details
Returns the index-position of the specified object in the list.
anObject
returnan int representing the index position, where 0 is the first position
public void setSelectedItem(Object anObject) Details
Set the value of the selected item. The selected item may be null.

anObjectThe combo box value or null for no selection.

public Object getSelectedItem()
public int getSize()