charvax.swing
Class DefaultComboBoxModel

java.lang.Object
  extended bycharvax.swing.AbstractListModel
      extended bycharvax.swing.DefaultComboBoxModel
All Implemented Interfaces:
ComboBoxModel, ListModel, MutableComboBoxModel

public class DefaultComboBoxModel
extends AbstractListModel
implements MutableComboBoxModel

The default model for combo boxes.


Field Summary
 
Fields inherited from class charvax.swing.AbstractListModel
_listeners
 
Constructor Summary
DefaultComboBoxModel()
          Default constructor
DefaultComboBoxModel(java.lang.Object[] items_)
          Constructs a DefaultComboBoxModel object initialized with an array of objects.
DefaultComboBoxModel(java.util.Vector items_)
          Constructs a DefaultComboBoxModel object initialized with a vector.
 
Method Summary
 void addElement(java.lang.Object obj_)
          Add the specified object to the end of the list.
 boolean contains(java.lang.Object elem_)
          Returns true if the specified element is in the list.
 java.lang.Object getElementAt(int index_)
          Returns the value at the specified index.
 java.lang.Object getSelectedItem()
          Return the selected item.
 int getSize()
          Returns the length of the list.
 int indexOf(java.lang.Object elem_)
          Returns the index of the first occurrence of the specified object.
 void insertElementAt(java.lang.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(java.lang.Object obj_)
          Remove the specified object from the model.
 void removeElementAt(int index_)
          Deletes the component at the specified index.
 void setSelectedItem(java.lang.Object anItem_)
          Set the selected item
 
Methods inherited from class charvax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface charvax.swing.ListModel
addListDataListener, removeListDataListener
 

Constructor Detail

DefaultComboBoxModel

public DefaultComboBoxModel()
Default constructor


DefaultComboBoxModel

public DefaultComboBoxModel(java.util.Vector items_)
Constructs a DefaultComboBoxModel object initialized with a vector.


DefaultComboBoxModel

public DefaultComboBoxModel(java.lang.Object[] items_)
Constructs a DefaultComboBoxModel object initialized with an array of objects.

Method Detail

getElementAt

public java.lang.Object getElementAt(int index_)
Returns the value at the specified index.

Specified by:
getElementAt in interface ListModel

getSize

public int getSize()
Returns the length of the list.

Specified by:
getSize in interface ListModel

contains

public boolean contains(java.lang.Object elem_)
Returns true if the specified element is in the list.


indexOf

public int indexOf(java.lang.Object elem_)
Returns the index of the first occurrence of the specified object.


getSelectedItem

public java.lang.Object getSelectedItem()
Return the selected item.

Specified by:
getSelectedItem in interface ComboBoxModel

setSelectedItem

public void setSelectedItem(java.lang.Object anItem_)
Set the selected item

Specified by:
setSelectedItem in interface ComboBoxModel

addElement

public void addElement(java.lang.Object obj_)
Add the specified object to the end of the list.

Specified by:
addElement in interface MutableComboBoxModel

removeElementAt

public void removeElementAt(int index_)
Deletes the component at the specified index.

Specified by:
removeElementAt in interface MutableComboBoxModel

removeAllElements

public void removeAllElements()
Removes all elements from this list and sets its size to zero.


insertElementAt

public void insertElementAt(java.lang.Object obj_,
                            int index_)
Insert an item at the specified index.

Specified by:
insertElementAt in interface MutableComboBoxModel

removeElement

public void removeElement(java.lang.Object obj_)
Remove the specified object from the model.

Specified by:
removeElement in interface MutableComboBoxModel