src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java

Print this page

        

@@ -52,16 +52,16 @@
 public class MetalComboBoxButton extends JButton {
 
     /**
      * The instance of {@code JComboBox}.
      */
-    protected JComboBox comboBox;
+    protected JComboBox<Object> comboBox;
 
     /**
      * The instance of {@code JList}.
      */
-    protected JList listBox;
+    protected JList<Object> listBox;
 
     /**
      * The instance of {@code CellRendererPane}.
      */
     protected CellRendererPane rendererPane;

@@ -79,18 +79,18 @@
     /**
      * Returns the {@code JComboBox}.
      *
      * @return the {@code JComboBox}
      */
-    public final JComboBox getComboBox() { return comboBox;}
+    public final JComboBox<Object> getComboBox() { return comboBox;}
 
     /**
      * Sets the {@code JComboBox}.
      *
      * @param cb the {@code JComboBox}
      */
-    public final void setComboBox( JComboBox cb ) { comboBox = cb;}
+    public final void setComboBox( JComboBox<Object> cb ) { comboBox = cb;}
 
     /**
      * Returns the icon of the {@code JComboBox}.
      *
      * @return the icon of the {@code JComboBox}

@@ -134,12 +134,12 @@
      * @param cb an instance of {@code JComboBox}
      * @param i an icon
      * @param pane an instance of {@code CellRendererPane}
      * @param list an instance of {@code JList}
      */
-    public MetalComboBoxButton( JComboBox cb, Icon i,
-                                CellRendererPane pane, JList list ) {
+    public MetalComboBoxButton( JComboBox<Object> cb, Icon i,
+                                CellRendererPane pane, JList<Object> list ) {
         this();
         comboBox = cb;
         comboIcon = i;
         rendererPane = pane;
         listBox = list;

@@ -153,12 +153,12 @@
      * @param i an icon
      * @param onlyIcon if {@code true} only icon is painted
      * @param pane an instance of {@code CellRendererPane}
      * @param list an instance of {@code JList}
      */
-    public MetalComboBoxButton( JComboBox cb, Icon i, boolean onlyIcon,
-                                CellRendererPane pane, JList list ) {
+    public MetalComboBoxButton( JComboBox<Object> cb, Icon i, boolean onlyIcon,
+                                CellRendererPane pane, JList<Object> list ) {
         this( cb, i, pane, list );
         iconOnly = onlyIcon;
     }
 
     public boolean isFocusTraversable() {

@@ -236,11 +236,11 @@
             return;
         }
 
         // Let the renderer paint
         if ( ! iconOnly && comboBox != null ) {
-            ListCellRenderer renderer = comboBox.getRenderer();
+             ListCellRenderer<Object> renderer = comboBox.getRenderer();
             Component c;
             boolean renderPressed = getModel().isPressed();
             c = renderer.getListCellRendererComponent(listBox,
                                                       comboBox.getSelectedItem(),
                                                       -1,