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

Wrong scrolling direction for TabPane

XMLWordPrintable

    • x86_64
    • windows_7

      If you open lots of Tabs in the TabPane, and you scroll up with your mouse wheel you will go to the right, if you scroll down, you will go to the left.

      But, IMHO, I've checked how Firefox and Netbeans are reacting and it's the opposite. I did not find any documenttion on a specific behavior but apparently it's the common setting on Window:
      wheel down = scroll right
      wheel up = scroll left

      In order to resolve that issue, you should only modify the TabPaneSkin in that way :
      "addEventHandler(ScrollEvent.SCROLL, (ScrollEvent e) -> {
                      Side side = getSkinnable().getSide();
                      side = side == null ? Side.TOP : side;
                      switch (side) {
                          default:
                          case TOP:
                          case BOTTOM:
                              setScrollOffset(scrollOffset + e.getDeltaY());
                              break;
                          case LEFT:
                          case RIGHT:
                              setScrollOffset(scrollOffset - e.getDeltaY());
                              break;
                      }

                  });'"

            jgiles Jonathan Giles
            shadzic Samir Hadzic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: