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

Strange mouse wheel/scrollbar behavior on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs
    • None
    • Fix Understood
    • x86
    • windows_2000

      Run the attached test. Rotate the mouse wheel while the cursor is over the Scrollbar, and the JScrollbar.

      The components in the test are layed out in the Frame as follows:

      [JScrollBar][Label][Scrollbar]

      Though the wheel events are correctly delivered, when the mouse wheel is rotated when the cursor is over the JScrollBar, the Scrollbar (on the other side of the Frame) is adjusted. Clearly, this is incorrect behavior. It's as if a ScrollPane were added, instead of a Scrollbar.

      After more experimentation, I learned that this is true if additional Swing components are added in the "middle" of the window - a JButton, for instance. The problem goes away if another heavyweight component (such as a Button) are added. The problems also disappear if the Scrollbar is the left-most Component in the Frame.

      So, the following configurations yield broken behavior:

      [JScrollBar][Label][Scrollbar]
      [JScrollBar][JButton][Label][Scrollbar]

      The following are okay:

      [JScrollBar][Button][Label][Scrollbar]
      [Scrollbar][Label][JScrollBar]

            Unassigned Unassigned
            bchristi Brent Christian
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: