JDK-8033000 : No Horizontal Mouse Wheel Support In BasicScrollPaneUI
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7u9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-01-28
  • Updated: 2022-07-12
  • Resolved: 2015-03-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b61Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
         
SHORT SUMMARY:

No Horizontal Mouse Wheel Support In BasicScrollPaneUI

DESCRIPTION:

May need to be broken out into two RFEs

Problem 1:
Few mouse like Apple Mighty Mouse and Trackpads support horizontal scrolling
through its wheel and with a magin mouse, horizontal wheel scrolling can be
done in Windows as well. But there appears to be no support in
MouseWheelEvent to determine horizontal or vertical scrolling. This prevents
us/scrollpane ui in providing such support

Problem 2:
Even if there is no in-built horizontal wheel scrolling through mouse, there
should be a way to do horizontal wheel scrolling (not clicking and dragging
horizontal scroll bar) in Java ScrollPane. With the following code in
BasicScrollPaneUI:

            if (scrollpane.isWheelScrollingEnabled() &&
                e.getWheelRotation() != 0) {
                JScrollBar toScroll = scrollpane.getVerticalScrollBar();
                int direction = e.getWheelRotation() < 0 ? -1 : 1;
                int orientation = SwingConstants.VERTICAL;

                // find which scrollbar to scroll, or return if none
                if (toScroll == null || !toScroll.isVisible()) {
                    toScroll = scrollpane.getHorizontalScrollBar();
                    if (toScroll == null || !toScroll.isVisible()) {
                        return;
                    }
                    orientation = SwingConstants.HORIZONTAL;
                }

the horizontal wheel scrolling is enabled only when vertical scrollbar is not
present. There should be a way to use some modifier like SHIFT/CTRL along
with mouse wheel scrolling to enable horizontal scrolling. For example Google
Chrome does this. 


Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/c2acbd0292f3 User: lana Date: 2015-04-23 01:41:22 +0000
23-04-2015

URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/c2acbd0292f3 User: alexsch Date: 2015-03-25 12:19:41 +0000
25-03-2015

The problem 1 is addressed to JDK-4419271 Provide support for scrolling-mechanisms of non-mouse input-devices The suggested fix for the problem 2 is to add shift modifier for the horizontal scrolling.
23-03-2015

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014