Package: javax.swing

## [Java] Class DefaultListModel

- javax.swing.DefaultListModel

-     public class DefaultListModel
      extends Object

  GDK enhancements for DefaultListModel.

  displayName:
    DefaultListModel
  receiverFqcn:
    javax.swing.DefaultListModel

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `clear()` Removes all elements from the DefaultListModel.
    `` | `public Iterator<?>` | `iterator()` Returns an Iterator which traverses the DefaultListModel one element at a time.
    `` | `public DefaultListModel<?>` | `leftShift(Object e)` Overloads the left shift operator to provide an easy way to add elements to a DefaultListModel.
    `` | `public void` | `putAt(int index, Object e)` Allow DefaultListModel to work with subscript operators.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, clamp, clamp, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, takeIf, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public void clear()

      Removes all elements from the DefaultListModel.

      Since:
        1.6.4

    - #### public Iterator<?> iterator()

      Returns an Iterator which traverses the DefaultListModel one element at a time.

      Returns:
        an Iterator for a DefaultListModel
      Since:
        1.6.4

    - #### public DefaultListModel<?> leftShift(Object e)

      Overloads the left shift operator to provide an easy way to add elements to a DefaultListModel.

      Parameters:
        `e` - an element to be added to the listModel.
      Returns:
        same listModel, after the value was added to it.
      Since:
        1.6.4

    - #### public void putAt(int index, Object e)

      Allow DefaultListModel to work with subscript operators.

      WARNING: this operation does not replace the element at the specified index, rather it inserts the element at that index, thus increasing the size of the model by 1.

      Parameters:
        `index` - the index of the element to replace
        `e` - the element to store at the given index
      Since:
        1.6.4