Java javax.swing DefaultListModel fields, constructors, methods, implement or subclass

Example usage for Java javax.swing DefaultListModel fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing DefaultListModel.

The text is from its open source code.

Subclass

javax.swing.DefaultListModel has subclasses.
Click this link to see all its subclasses.

Constructor

Method

voidadd(int index, E element)
Inserts the specified element at the specified position in this list.
voidaddElement(E element)
Adds the specified component to the end of this list.
intcapacity()
Returns the current capacity of this list.
voidclear()
Removes all of the elements from this list.
booleancontains(Object elem)
Tests whether the specified object is a component in this list.
voidcopyInto(Object[] anArray)
Copies the components of this list into the specified array.
EelementAt(int index)
Returns the component at the specified index.
Enumerationelements()
Returns an enumeration of the components of this list.
voidensureCapacity(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.
EfirstElement()
Returns the first component of this list.
Eget(int index)
Returns the element at the specified position in this list.
EgetElementAt(int index)
Returns the component at the specified index.
intgetSize()
Returns the number of components in this list.
intindexOf(Object elem, int index)
Searches for the first occurrence of elem , beginning the search at index .
intindexOf(Object elem)
Searches for the first occurrence of elem .
voidinsertElementAt(E element, int index)
Inserts the specified element as a component in this list at the specified index.
booleanisEmpty()
Tests whether this list has any components.
ElastElement()
Returns the last component of the list.
intlastIndexOf(Object elem)
Returns the index of the last occurrence of elem .
intlastIndexOf(Object elem, int index)
Searches backwards for elem , starting from the specified index, and returns an index to it.
Eremove(int index)
Removes the element at the specified position in this list.
voidremoveAllElements()
Removes all components from this list and sets its size to zero.
booleanremoveElement(Object obj)
Removes the first (lowest-indexed) occurrence of the argument from this list.
voidremoveElementAt(int index)
Deletes the component at the specified index.
voidremoveRange(int fromIndex, int toIndex)
Deletes the components at the specified range of indexes.
Eset(int index, E element)
Replaces the element at the specified position in this list with the specified element.
voidsetElementAt(E element, int index)
Sets the component at the specified index of this list to be the specified element.
voidsetSize(int newSize)
Sets the size of this list.
intsize()
Returns the number of components in this list.
Object[]toArray()
Returns an array containing all of the elements in this list in the correct order.
StringtoString()
Returns a string that displays and identifies this object's properties.
voidtrimToSize()
Trims the capacity of this list to be the list's current size.