List Models

JList can store its data in a Default List Model...

JList
+ JList(Object[])
+ setListData(Object[])
+ getSelectedValue() : Object
+ getSelectedValues() : Object[]
+ isSelectionEmpty() : boolean
... more
DefaultListModel
+ getElementAt(int) : Object
+ getSize() : int
+ addElement(Object)
+ removeElement(Object) : boolean
... lots more
« Interface »
ListModel
+ addListDataListener(ListDataListener)
+ removeListDataListener(ListDataListener)
+ getElementAt(int) : Object
+ getSize() : int

« abstract »
AbstractListModel
# listenerList : EventListenerList
# fireContentsChanged(Object, int, int)
+ addListDataListener(ListDataListener)
+ removeListDataListener(ListDataListener)

...but for more flexibility we implement our own Data List Model.

JList
+ JList(ListModel)
+ setModel(ListModel)
+ setCellRenderer(ListCellRenderer)
+ getSelectedValue() : Object
+ getSelectedValues() : Object[]
... more
DataListModel
+ setData(Object[], String)
+ getElementAt(int) : Object
+ getSize() : int
+ contains(Object) : boolean
+ getDescription() : String
+ getRedLine(int) : Object
+ iterator() : Iterator
« Interface »
ListModel
+ addListDataListener(ListDataListener)
+ removeListDataListener(ListDataListener)
+ getElementAt(int) : Object
+ getSize() : int

« abstract »
AbstractListModel
# listenerList : EventListenerList
# fireContentsChanged(Object, int, int)
+ addListDataListener(ListDataListener)
+ removeListDataListener(ListDataListener)