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

JComboBox too small under Windows LAF

XMLWordPrintable

    • b161
    • 9
    • b169
    • x86_64
    • windows_7

        FULL PRODUCT VERSION :
        java version "9-ea"
        Java(TM) SE Runtime Environment (build 9-ea+165)
        Java HotSpot(TM) Server VM (build 9-ea+165, mixed mode, emulated-client)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7601]

        A DESCRIPTION OF THE PROBLEM :
        Under Windows LAF, JComboBox is too small. The height is smaller than for a native combobox and in the non-editable combobox in the test case, the selected item doesn't fit and is rendered with ellipses.

        REGRESSION. Last worked in version 8u131

        ADDITIONAL REGRESSION INFORMATION:
        The JComboBox change in b161 (Changeset: 743970d86b39 Bug ID:6490753) seems to have introduced the problem.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        java ComboBoxLab


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.awt.FlowLayout;

        import javax.swing.JComboBox;
        import javax.swing.JFrame;
        import javax.swing.JTextField;
        import javax.swing.UIManager;

        public class ComboBoxLab extends JFrame
        {
           public ComboBoxLab()
           {
              setDefaultCloseOperation( EXIT_ON_CLOSE );

              getContentPane().setLayout( new FlowLayout() );

              getContentPane().add( new JTextField( "item 1" ) );

              JComboBox< String > cboRo = new JComboBox< String >( new String[] { "item 1", "item 2", "item 3" } );
              getContentPane().add( cboRo );

              JComboBox< String > cboRw = new JComboBox< String >( new String[] { "item 1", "item 2", "item 3" } );
              cboRw.setEditable( true );
              getContentPane().add( cboRw );

              pack();
              setVisible( true );
           }

           public static void main( String[] args ) throws Exception
           {
              UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
              new ComboBoxLab();
           }

        }

        ---------- END SOURCE ----------

          1. 8u131.PNG
            8u131.PNG
            3 kB
          2. 8u131.PNG
            8u131.PNG
            3 kB
          3. 9eab166.PNG
            9eab166.PNG
            3 kB
          4. 9eab166.PNG
            9eab166.PNG
            3 kB
          5. ComboBoxLab.java
            1.0 kB
          6. ComboBoxLab.java
            1.0 kB

              ssadetsky Semyon Sadetsky (Inactive)
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: