JDK-8052123 : Horizontal scrolling not possible with touchpad with Metal and Nimbus L&F
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86
  • Submitted: 2014-07-26
  • Updated: 2022-07-12
  • Resolved: 2022-07-12
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.
Other
tbdResolved
Related Reports
Duplicate :  
Relates :  
Description
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 ----------


Comments
Works with Metal, Nimbus in SwingSet2
12-07-2022

This bug is "In Progress" status now, so re-targeting back to Fix Version 9. If you are not working on this bug fix anymore, please update the bug from "In Progress" to just "Open"
13-11-2015