Horizontal scrolling not possible with touchpad with Metal and Nimbus L&F when both scrollbars are visible
Gregg Wonderly
gregg at wonderly.org
Thu Jul 31 03:32:31 UTC 2014
It would be prudent to have a try {} finally {} around the disable/enable so that runtime exceptions don’t leave the UI in an odd state.
Gregg Wonderly
On Jul 30, 2014, at 10:43 AM, Mike Swingler <swingler at apple.com> wrote:
> FYI, the code to do horizontal scroll in Aqua is in <http://hg.openjdk.java.net/jdk9/client/jdk/file/tip/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java>. The whole point of this class is to do the "grody hack". ;-)
>
> Cheers,
> Mike Swingler
> Apple Inc.
>
> On Jul 26, 2014, at 4:54 AM, Robert Krüger <krueger at lesspain.de> wrote:
>
>> OK, I have done that. Btw, are there any concrete plans to migrate
>> that to Jira as well?
>>
>> Thanks,
>>
>> Robert
>>
>> On Fri, Jul 25, 2014 at 4:23 PM, Alexander Scherbatiy
>> <alexandr.scherbatiy at oracle.com> wrote:
>>>
>>> Please, file the bug report in http://bugreport.java.com/bugreport
>>>
>>> Thanks,
>>> Alexandr.
>>>
>>>
>>> On 7/25/2014 10:34 AM, Robert Krüger wrote:
>>>>
>>>> Hi,
>>>>
>>>> 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.
>>>>
>>>> This little example demonstrates the problem:
>>>>
>>>> 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);
>>>> }
>>>> }
>>>>
>>>> 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.
>>>>
>>>> Tested systematically with JDKs 6_51 and 8_11 but observed with all
>>>> production releases of 8 before as well.
>>>>
>>>> Is this a known bug?
>>>>
>>>> Is there a known workaround (hacking the Look & Feel is also an option
>>>> because we override it in our application anyway)? There must be as
>>>> IntelliJ Idea does not have this problem and they are not using Aqua
>>>> but I have failed to find it in their code.
>>>>
>>>> Does it make sense to file a bug report and if so where?
>>>>
>>>> Best,
>>>>
>>>> Robert
>>>
>>>
>>
>>
>>
>> --
>> Robert Krüger
>> Managing Partner
>> Lesspain GmbH & Co. KG
>>
>> www.lesspain-software.com
>
More information about the macosx-port-dev
mailing list