RFR: 5021949: JSplitPane setEnabled(false) shouldn't be partially functional [v2]
Abhishek Kumar
abhiscxk at openjdk.org
Fri Jun 14 08:47:13 UTC 2024
On Fri, 14 Jun 2024 03:52:56 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> Issue is seen in that if we call setEnabled(false) over JSplitPane than it can't be dragged via its divider, But if SplitPane have one touch expandable true than user can click those buttons and change the divider position.
>> So, if splitpane is disabled, then both dragging in divider and one-touch-expandable click should be disabled.
>> Fix is made to override setEnabled and disable one-touch-expandable buttons actions..
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> L&F iteration
test/jdk/javax/swing/JSplitPane/TestSplitPaneEnableTest.java line 77:
> 75: new JButton("Right"));
> 76:
> 77: frame.getContentPane().add(jsp);
Suggestion:
frame.add(jsp);
test/jdk/javax/swing/JSplitPane/TestSplitPaneEnableTest.java line 92:
> 90:
> 91: SwingUtilities.invokeAndWait(() -> {
> 92: loc = leftOneTouchButton.getLocationOnScreen();
Ran the test on ubuntu 22.04, test failed with `IllegalComponentStateException: component must be showing on the screen to determine its location` for GTK L&F.
There is no such touch button available for JSplitPane divider.
May skip testing for GTK.

-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19695#discussion_r1639483295
PR Review Comment: https://git.openjdk.org/jdk/pull/19695#discussion_r1639477859
More information about the client-libs-dev
mailing list