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

No Horizontal Mouse Wheel Support In BasicScrollPaneUI

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 7u9
    • client-libs

                 
        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.

              alexsch Alexandr Scherbatiy
              asaha Abhijit Saha
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: