Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6519410

too big vertical padding within JComboBox'es on Metal L&F/OceanTheme

XMLWordPrintable

      FULL PRODUCT VERSION :
      1.6.0-b105

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP SP2

      A DESCRIPTION OF THE PROBLEM :
      Uneditable JComboBox'es with a DefaultCellRenderer have one pixel too much at their bottom padding. It seems like the bug is in the OceanTheme.

      For example, if you create a JComboBox with 20 pixels of height and use a Jlabel with an Icon (set via JLabel#setIcon(Icon)) as the CellRenderer, the first row of pixels at the top are not longer visible since Java 5.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      the bug is reproducible just by comparing the paddings of JComboBox'es under j5 and j6.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      fixing JComboBox'es paddings

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import javax.swing.*;


      public class Test {

        public static void main(String[] args) {
          JFrame frm = new JFrame();
          frm.setBounds(100, 100, 200, 100);
          frm.setLayout(null);
          JComboBox cb = new JComboBox(new String[] {"Value 1", "Value 2", "Value 3"});
          cb.setBounds(30, 30, 100, 20);
          frm.add(cb);
          frm.setVisible(true);
        }

      }
      ---------- END SOURCE ----------

            alexp Alexander Potochkin (Inactive)
            keshah Ketan Shah (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: