Package adams.gui.core
Class JComponentList.JComponentListModel
- java.lang.Object
-
- javax.swing.AbstractListModel<E>
-
- javax.swing.DefaultListModel
-
- adams.gui.core.JComponentList.JComponentListModel
-
- All Implemented Interfaces:
Serializable
,ListModel
- Enclosing class:
- JComponentList
public static class JComponentList.JComponentListModel extends DefaultListModel
A specialized model.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
DefaultListModel
, Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description JComponentListModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, Object element)
Inserts the specified JComponent at the specified position in this list.void
addElement(Object obj)
Adds the specified JComponent to the end of this list.Object
set(int index, Object element)
Replaces the JComponent at the specified position in this list with the specified JComponent.void
setElementAt(Object obj, int index)
Sets the JComponent at the specified index of this list to be the specified object.-
Methods inherited from class javax.swing.DefaultListModel
addAll, addAll, capacity, clear, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getElementAt, getSize, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, setSize, size, toArray, toString, trimToSize
-
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
-
-
-
Method Detail
-
add
public void add(int index, Object element)
Inserts the specified JComponent at the specified position in this list.- Overrides:
add
in classDefaultListModel
- Parameters:
index
- index at which the specified element is to be insertedelement
- JComponet to be inserted
-
addElement
public void addElement(Object obj)
Adds the specified JComponent to the end of this list.- Overrides:
addElement
in classDefaultListModel
- Parameters:
obj
- the JComponent to be added
-
set
public Object set(int index, Object element)
Replaces the JComponent at the specified position in this list with the specified JComponent.- Overrides:
set
in classDefaultListModel
- Parameters:
index
- index of JComponent to replaceelement
- JComponent to be stored at the specified position- Returns:
- the JComponent previously at the specified position
-
setElementAt
public void setElementAt(Object obj, int index)
Sets the JComponent at the specified index of this list to be the specified object.- Overrides:
setElementAt
in classDefaultListModel
- Parameters:
obj
- what the JComponent is to be set toindex
- the specified index
-
-