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

JComboBox still scrolling if switch to another window and return back.

    XMLWordPrintable

Details

    • Cause Known
    • x86
    • generic

    Description

      FULL PRODUCT VERSION :
      java version "1.6.0_03"
      Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
      Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      When we scroll down a JComboBox using its up or down button in it's dropdown's scrollbars, and then we switch to another window using Alt+Tab (without releasing the mouse). Now we relase the mouse and then we come back using Alt+Tab. Now open the dropdown of the combobox, you will see that the scrollbar is still scrolling.

      This problem is reproduced in 1.4.2, and there it is still worse. In 1.4.2 when we switch back to the original java app, we see that the JCombox's dropdown is not clossed and is still scrolling.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Make a JCombobox. Add around 300 items in it.
      2. Open the dropdown and press the mouse button on the scrollbars' down button
      3. Now without releasing the mouse, switch to another window using Alt+Tab
      4. Now release the mouse.
      5.Switch back to original window.
      6. If using Java 6, then open dropdown and you can see that it is still scrolling. In Jsdk 1.4 it does,nt even close and it keeps on scrolling.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The dropdown of the JCombobox should stop scrolling when we switch back.
      ACTUAL -
      The drop down of the JcomboBox is still scrolling even though the mosue was released.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JComboBox;
      import javax.swing.JFrame;

      public class abc
      {
          public static void main(String[] args)
          {
              JFrame f = new JFrame("");
              f.setSize(100 , 50);
              JComboBox box = new JComboBox();
              for (int i = 0; i< 100; i ++)
              {
                  box.addItem("Shello");
                  
              }
              
              f.getContentPane().add(box);
              f.setVisible(true);
              f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
          }
      }

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

      Attachments

        Activity

          People

            dnguyen Damon Nguyen
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Imported:
              Indexed: