API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing. DefaultListModel View Source
Author(s)
Hans Muller
Since
Version
1.36 11/17/05
Serial
Hierarchy
 Object
      AbstractListModel
          DefaultListModel
Implements
Subclasses
Description
public class DefaultListModel
  This class loosely implements the java.util.Vector API, in that it implements the 1.1.x version of java.util.Vector, has no collection class support, and notifies the ListDataListeners when changes occur.
See also:   
Constructors
public DefaultListModel ()
Methods
Hide/Show inherited methods
public void add (int index, Object element)
  Inserts the specified element at the specified position in this list.
public void addElement (Object obj)
  Adds the specified component to the end of this list.
public void addListDataListener (ListDataListener l) [Inherited From AbstractListModel]
  Adds a listener to the list that's notified each time a change to the data model occurs.
public int capacity ()
  Returns the current capacity of this list.
public void clear ()
  Removes all of the elements from this list.
public boolean contains (Object elem)
  Tests whether the specified object is a component in this list.
public void copyInto (Object anArray)
  Copies the components of this list into the specified array.
public Object elementAt (int index)
  Returns the component at the specified index.
public Enumeration<Object> elements ()
  Returns an enumeration of the components of this list.
public void ensureCapacity (int minCapacity)
  Increases the capacity of this list, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.
protected void fireContentsChanged (Object source, int index0, int index1) [Inherited From AbstractListModel]
  AbstractListModel subclasses must call this method after one or more elements of the list change.
protected void fireIntervalAdded (Object source, int index0, int index1) [Inherited From AbstractListModel]
  AbstractListModel subclasses must call this method after one or more elements are added to the model.
protected void fireIntervalRemoved (Object source, int index0, int index1) [Inherited From AbstractListModel]
  AbstractListModel subclasses must call this method after one or more elements are removed from the model.
public Object firstElement ()
  Returns the first component of this list.
public Object get (int index)
  Returns the element at the specified position in this list.
public Object getElementAt (int index)
  Returns the component at the specified index.
public ListDataListener getListDataListeners () [Inherited From AbstractListModel]
  Returns an array of all the list data listeners registered on this AbstractListModel.
public T getListeners (Class< T> listenerType) [Inherited From AbstractListModel]
  Returns an array of all the objects currently registered as FooListeners upon this model.
public int getSize ()
  Returns the number of components in this list.
public int indexOf (Object elem)
  Searches for the first occurrence of elem.
public int indexOf (Object elem, int index)
  Searches for the first occurrence of elem, beginning the search at index.
public void insertElementAt (Object obj, int index)
  Inserts the specified object as a component in this list at the specified index.
public boolean isEmpty ()
  Tests whether this list has any components.
public Object lastElement ()
  Returns the last component of the list.
public int lastIndexOf (Object elem)
  Returns the index of the last occurrence of elem.
public int lastIndexOf (Object elem, int index)
  Searches backwards for elem, starting from the specified index, and returns an index to it.
public Object remove (int index)
  Removes the element at the specified position in this list.
public void removeAllElements ()
  Removes all components from this list and sets its size to zero.
public boolean removeElement (Object obj)
  Removes the first (lowest-indexed) occurrence of the argument from this list.
public void removeElementAt (int index)
  Deletes the component at the specified index.
public void removeListDataListener (ListDataListener l) [Inherited From AbstractListModel]
  Removes a listener from the list that's notified each time a change to the data model occurs.
public void removeRange (int fromIndex, int toIndex)
  Deletes the components at the specified range of indexes.
public Object set (int index, Object element)
  Replaces the element at the specified position in this list with the specified element.
public void setElementAt (Object obj, int index)
  Sets the component at the specified index of this list to be the specified object.
public void setSize (int newSize)
  Sets the size of this list.
public int size ()
  Returns the number of components in this list.
public Object toArray ()
  Returns an array containing all of the elements in this list in the correct order.
public String toString ()
  Returns a string that displays and identifies this object's properties.
public void trimToSize ()
  Trims the capacity of this list to be the list's current size.
Fields
Hide/Show inherited fields
protected EventListenerList listenerList [Inherited From AbstractListModel]
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar