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

Horizontal scrolling not possible with touchpad with Metal and Nimbus L&F

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.8.0_11"
      Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
      Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin Roberts-MacBook-Pro.local 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      horizontal scrolling in a JScrollPane does not work with a touchpad
      with Metal and Nimbus Look & Feel when both scrollbars are visible.
      It does work with Aqua.

      The example in the code field demonstrates the problem:



      Tested systematically with JDKs 6_51 and 8_11 but observed with all
      production releases of 8 before as well.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute the example code, expand the tree a bit and resize the window so that both scrollbars are visible. Making a horizontal scroll gesture on the touchpad results in vertical scrolling.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Making a horizontal scroll gesture on the touchpad results in horizontal scrolling.
      ACTUAL -
      Making a horizontal scroll gesture on the touchpad results in vertical scrolling when both scrollbars are shown.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class TestTreeScrolling {
          public static void main(String[] args) throws Exception {
              for (UIManager.LookAndFeelInfo info :
      UIManager.getInstalledLookAndFeels()) {
                  if (info.getName().startsWith("Nimbus")) {
                      UIManager.setLookAndFeel(info.getClassName());
                      break;
                  }
              }
              final JFrame frame = new
      JFrame(TestTreeScrolling.class.getSimpleName());
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

              final JScrollPane scrollPane = new JScrollPane(new JTree());
              scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
              scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
              frame.getContentPane().add(scrollPane);
              frame.pack();
              frame.setVisible(true);
          }
      }

      ---------- END SOURCE ----------

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: