Module java.desktop
Package javax.swing

Class DefaultComboBoxModel<E>

    • Constructor Detail

      • DefaultComboBoxModel

        public DefaultComboBoxModel()
        Constructs an empty DefaultComboBoxModel object.
      • DefaultComboBoxModel

        public DefaultComboBoxModel​(E[] items)
        Constructs a DefaultComboBoxModel object initialized with an array of objects.
        items - an array of Object objects
      • DefaultComboBoxModel

        public DefaultComboBoxModel​(Vector<E> v)
        Constructs a DefaultComboBoxModel object initialized with a vector.
        v - a Vector object ...
    • Method Detail

      • setSelectedItem

        public void setSelectedItem​(Object anObject)
        Set the value of the selected item. The selected item may be null.
        Specified by:
        setSelectedItem in interface ComboBoxModel<E>
        anObject - The combo box value or null for no selection.
      • getIndexOf

        public int getIndexOf​(Object anObject)
        Returns the index-position of the specified object in the list.
        anObject - the object to return the index of
        an int representing the index position, where 0 is the first position
      • removeAllElements

        public void removeAllElements()
        Empties the list.