RFR: 6442919: JFilechooser popup still left-to-right when JFilechooser is set to right-to-left [v2]

Damon Nguyen dnguyen at openjdk.org
Fri Jul 21 06:27:55 UTC 2023


On Fri, 21 Jul 2023 03:56:03 GMT, Tejesh R <tr at openjdk.org> wrote:

>> Popup menu is created on mouse click, hence the orientation for FileChooser won't apply to the popup menu created. Hence the fix address the issue by applying the FileChooser orientation when it is created on mouse operation (Right Click). 
>> The test does not apply to Motif and Aqua Look And Feel since right click is not supported on filePane of FileChooser, hence it is skipped. The fix is tested in CI and it is green.
>
> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Skip GTK L&F

src/java.desktop/share/classes/sun/swing/FilePane.java line 1936:

> 1934:         }
> 1935: 
> 1936:         contextMenu.applyComponentOrientation(getFileChooser().getComponentOrientation());

I see that this bug is old. Seems like a simple way to fix this and I see similar calls for other UI elements, like JMenu. It looks like in JMenu, it iterates through all components and sets it orientation, but it looks like the popup is the only problem, so looks fine.

You still need to update the year in the header of FilePane.

test/jdk/javax/swing/JFileChooser/FCPopupMenuOrientationTest.java line 76:

> 74:         try {
> 75:             UIManager.setLookAndFeel(laf.getClassName());
> 76:             System.out.println("Set L&F : "+laf.getName());

Suggestion:

            System.out.println("Set L&F : " + laf.getName());

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14949#discussion_r1270269782
PR Review Comment: https://git.openjdk.org/jdk/pull/14949#discussion_r1270269958



More information about the client-libs-dev mailing list