< prev index next >

## src/java.desktop/share/classes/javax/swing/ComboBoxModel.java

Print this page

    rev 48858 : Work in progress for JDK-6303622
    Use generic in Swing components like JComboBox
    1. Added generic return type and parameter type for JComboBox.
    2. Modified JList related classes as well.
    3. Reverted the changes made to "getSelectedValues" as suggested by Joe.
    4. Modified files that were failing on Linux and Mac as well.

    @@ -43,16 +43,18 @@
       /**
        * Set the selected item. The implementation of this  method should notify
        * all registered <code>ListDataListener</code>s that the contents
        * have changed.
        *
    +   * @param <E> the type of the elements of this model.
        * @param anItem the list object to select or <code>null</code>
        *        to clear the selection
        */
    -  void setSelectedItem(Object anItem);
    +  void setSelectedItem(E anItem);

       /**
        * Returns the selected item
    +   * @param <E> the type of the elements of this model.
        * @return The selected item or <code>null</code> if there is no selection
        */
    -  Object getSelectedItem();
    +  E getSelectedItem();
     }

< prev index next >