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

JComboBox Popup wrongly placed when windows task bar is on left side.

XMLWordPrintable

      FULL PRODUCT VERSION :
      1.4.2_10 and 1.5_10, 6.0 build105

      ADDITIONAL OS VERSION INFORMATION :
      tested on Windows 2000 but should be applicable on other such as XP

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Move the windows task bar on the left side and make it wide( it will be more evident)

      A DESCRIPTION OF THE PROBLEM :
      When the windows task bar is put left side and the combo box is at right most of the screen it will be shifted left.

      It seems that the computePopupBounds assumes that the screen start at pixel position 0,0. But in that specific case the orginin should be at (TASKBAR_WIDTH,0)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Simply move the windows task bar on the left side and create a class Test with the provided code

      Run the class and click on the JComboBox.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The popup should appear beneath the frame.
      ACTUAL -
      The popup is left-shifted by the width of the task bar.

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

      import javax.swing.JComboBox;
      import javax.swing.JFrame;

      public class Test {
        public static void main(String[] args) {
          JFrame frame = new JFrame("JComboBox Bug");
          Rectangle bounds = frame.getGraphicsConfiguration().getBounds();
          int frameWidth = 200;
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.getContentPane().add(new JComboBox());
          frame.setBounds(bounds.width - frameWidth, 0, frameWidth ,100);
          frame.setVisible(true);
        }
      }

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

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: