RFR: 4265389: JSplitPane does not support ComponentOrientation [v7]
Abhishek Kumar
abhiscxk at openjdk.org
Mon Jul 22 09:39:32 UTC 2024
On Mon, 22 Jul 2024 09:31:55 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> JSplitPane's support of CompoentOrientation is not present so if orientation is RTL, it still renders left component on left and right component on right instead of other way around..
>> Fix to make it support RTL orientation
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> Use isLeftToRight method instead of explicit check
src/java.desktop/share/classes/javax/swing/JSplitPane.java line 375:
> 373: Component leftComponent = this.getLeftComponent();
> 374: Component rightComponent = this.getRightComponent();
> 375: if (!this.getComponentOrientation().isLeftToRight()) {
Just a suggestion, may not require to check for the `!` now as LTR or UNKNOWN can be handled together when `isLeftToRight` returns **true**. It is slightly confusing to understand.
Need a bit of code swapping between if-else block.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20214#discussion_r1686262037
More information about the client-libs-dev
mailing list