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

REGRESSION: JComboBox minimum width is to narrow with Windows XP L&F

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
      5.0
    • Resolved In Build:
      b07
    • CPU:
      x86
    • OS:
      windows_xp
    • Verification:
      Verified

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP SP1

      A DESCRIPTION OF THE PROBLEM :
      The minimum width for a JComboBox is set too small, causing the text to be cut off and replaced with "..." in some situations.

      See Bug 4966585 and 4978939.

      I believe 4966585 should be re-opened.

      Depending on complex interactions with the layout manager the bug may present itself as soon as the UI is shown, or more easily it is observed if the use is able to resize part of the UI, the JComboBox allows itself to shrink too much.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the test case provided below, resize the splitter to see the combo box shrink too small.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Text in the combo box should not get cut off
      ACTUAL -
      Text in the combo box gets cut off, replaced with "..."

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

      import javax.swing.Box;
      import javax.swing.JButton;
      import javax.swing.JComboBox;
      import javax.swing.JLabel;
      import javax.swing.JFrame;
      import javax.swing.JPanel;
      import javax.swing.JScrollPane;
      import javax.swing.JSplitPane;
      import javax.swing.UIManager;
      import javax.swing.UnsupportedLookAndFeelException;

      public class ComboWidth extends JFrame
      {

          public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException
          {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              ComboWidth cw = new ComboWidth();
              cw.pack();
              cw.setVisible(true);
          }

          private ComboWidth()
          {
              super("ComboWidth");
              JComboBox cb = new JComboBox( new String [] {
                      "Queued Mode", "Concurrent Mode", "Batch Mode"} );

              JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
              split.add(cb);
              split.add(new JLabel("<- Slide the splitter."));
              split.setContinuousLayout(true);
              split.setBorder(null);

              getContentPane().add(split, BorderLayout.CENTER);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              cb.setSelectedIndex(1);
          }
      }

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

      Release Regression From : 1.4.2
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.
      ###@###.### 10/29/04 23:46 GMT

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shickeysunw Shannon Hickey (Inactive)
              Reporter:
              gmanwanisunw Girish Manwani (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: