< prev index next >

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

Print this page

    rev 48358 : 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.

    @@ -43,16 +43,17 @@
       /**
        * 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
        * @return The selected item or <code>null</code> if there is no selection
        */
    -  Object getSelectedItem();
    +  E getSelectedItem();
     }

< prev index next >