javax.swing
Interface MutableComboBoxModel

All Superinterfaces:
ComboBoxModel, ListModel
All Known Implementing Classes:
DefaultComboBoxModel

public interface MutableComboBoxModel
extends ComboBoxModel

A data model used in JComboBoxes that keeps track of the components data and provides methods to insert and remove elements from it. The classes implementing this interface should fire appropriate events indicating the undergoing change in the data model.


Method Summary
 void addElement(Object object)
          This method adds given object to its data model.
 void insertElementAt(Object object, int index)
          This method inserts givent element to the data model, at the specified index.
 void removeElement(Object object)
          This method removes given element from the data model
 void removeElementAt(int index)
          This method removes elements located at the given index in the data model.
 
Methods inherited from interface javax.swing.ComboBoxModel
getSelectedItem, setSelectedItem
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, getElementAt, getSize, removeListDataListener
 

Method Detail

addElement

void addElement(Object object)
This method adds given object to its data model.

Parameters:
object - element to add to the data model.

removeElementAt

void removeElementAt(int index)
This method removes elements located at the given index in the data model.

Parameters:
index - index specifying location of the element to remove.

insertElementAt

void insertElementAt(Object object,
                     int index)
This method inserts givent element to the data model, at the specified index.

Parameters:
object - element to insert
index - index specifying the position in the data model where the given element should be inserted.

removeElement

void removeElement(Object object)
This method removes given element from the data model

Parameters:
object - element to remove.