RFR: 4265389: JSplitPane does not support ComponentOrientation [v6]

Tejesh R tr at openjdk.org
Mon Jul 22 09:21:32 UTC 2024


On Fri, 19 Jul 2024 08:05:06 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:
> 
>   whitespace removal

> > I hope Component Orientation should be applied recursively throughout its children components. Here the Orientation applied to JSplitPane is not set/applied to its left/right components, probably you may have to set them explicitly in `JSplitPane.setComponentOrientation()` ?
> 
> I think splitpane is only about left/right component and the orientation is applied to them only ie left component will be placed right and viceversa for RTL orientation, the components internal orientation needs to be controlled by the component individually in this case as JSplitPane is only about spliiting 2 existing components spec says so "JSplitPane is used to divide two (and only two) * `Component`s" so I interpret is as it will just divide/split 2 components and not meddle into the component's internal implementation...

Hmm, probably yes because in `JComponent.setComponentOrientation()` spec it says "_To set the orientation of a single component, use this method. To set the orientation of an entire component hierarchy, use [applyComponentOrientation](https://docs.oracle.com/en/java/javase/22/docs/api/java.desktop/java/awt/Component.html#applyComponentOrientation(java.awt.ComponentOrientation))._".

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

PR Comment: https://git.openjdk.org/jdk/pull/20214#issuecomment-2242484915


More information about the client-libs-dev mailing list