public class DefaultListModel extends AbstractListModel
ListModel implementation.| Constructor and Description |
|---|
DefaultListModel()
Creates a new
DefaultSelectListModel with the given
content. |
DefaultListModel(java.lang.Object[] itemArray)
Creates a new
DefaultSelectListModel containing the
specified items |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
java.lang.Object item)
Inserts an item at the specified index.
|
void |
add(java.lang.Object item)
Adds an item at the end of the model.
|
boolean |
equals(java.lang.Object o) |
java.lang.Object |
get(int index)
Returns the item at the specified index in the list.
|
int |
hashCode() |
int |
indexOf(java.lang.Object item)
Returns the index of the specified item.
|
void |
remove(int index)
Removes the item at the specified index from the model.
|
void |
remove(java.lang.Object item)
Removes the specified item from the model.
|
void |
removeAll()
Removes all items from the model.
|
int |
size()
Returns the length of the list.
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getEventListenerList, removeListDataListenerpublic DefaultListModel()
DefaultSelectListModel with the given
content.public DefaultListModel(java.lang.Object[] itemArray)
DefaultSelectListModel containing the
specified itemsitemArray - the initial itemspublic void add(java.lang.Object item)
item - the item to addpublic void add(int index,
java.lang.Object item)
item - the itemindex - the indexpublic boolean equals(java.lang.Object o)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public java.lang.Object get(int index)
index - public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public int indexOf(java.lang.Object item)
item - the itempublic void remove(int index)
index - the indexpublic void remove(java.lang.Object item)
item - the itempublic void removeAll()
public int size()