charvax.swing

Interface ListModel

Known Subinterfaces:
ComboBoxModel, MutableComboBoxModel
Known Implementing Classes:
AbstractListModel, DefaultComboBoxModel, DefaultListModel

public interface ListModel

This interface defines the methods by which components such as JList get the value of each cell in a list, and the length of the list.

Conceptually, the model is a Vector; indices vary from 0 to getSize() - 1.

Method Summary

void
addListDataListener(ListDataListener l)
Register an object that will be notified when the list contents change.
Object
getElementAt(int index)
Returns the value at the specified index.
int
getSize()
Returns the length of the list.
void
removeListDataListener(ListDataListener l)
Remove the specified ListDataListener.

Method Details

addListDataListener

public void addListDataListener(ListDataListener l)
Register an object that will be notified when the list contents change.

getElementAt

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

getSize

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

removeListDataListener

public void removeListDataListener(ListDataListener l)
Remove the specified ListDataListener.