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

No Horizontal Mouse Wheel Support In BasicScrollPaneUI

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7u9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:

      Backports

        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.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  alexsch Alexander Scherbatiy (Inactive)
                  Reporter:
                  asaha Abhijit Saha
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: