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

Print this page

        

@@ -48,18 +48,18 @@
  * @see MetalComboBoxButton
  * @author Tom Santos
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class MetalComboBoxButton extends JButton {
-    protected JComboBox comboBox;
-    protected JList listBox;
+    protected JComboBox<Object> comboBox;
+    protected JList<Object> listBox;
     protected CellRendererPane rendererPane;
     protected Icon comboIcon;
     protected boolean iconOnly = false;
 
-    public final JComboBox getComboBox() { return comboBox;}
-    public final void setComboBox( JComboBox cb ) { comboBox = cb;}
+    public final JComboBox<Object> getComboBox() { return comboBox;}
+    public final void setComboBox( JComboBox<Object> cb ) { comboBox = cb;}
 
     public final Icon getComboIcon() { return comboIcon;}
     public final void setComboIcon( Icon i ) { comboIcon = i;}
 
     public final boolean isIconOnly() { return iconOnly;}

@@ -73,22 +73,22 @@
             }
         };
         setModel( model );
     }
 
-    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;
         setEnabled( comboBox.isEnabled() );
     }
 
-    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() {

@@ -166,11 +166,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,