On Mon, 20 Nov 2023 10:56:59 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> For RTL orientation 
>> [`getCellRect`](https://github.com/openjdk/jdk/blob/6c5e15c1a291ca5ba1e4c3a90351bc71665ce988/src/java.desktop/share/classes/javax/swing/JTable.java#L2977)
>>   returns position excluding the Offset meaning the gap between panel x till 
>> x position of table which is x position of first column.  So instead of 
>> modifying at JTable class, I am updating here.
>
> but we dont seem to have any issue with LTR rendering, so why this 
> getXPosition is needed for LTR too?
> Also, wouldn't existing `getRowMargin` have helped?

LTR rendering will work unless the Table is fully occupied w.r.t the Panel. 
Here the Max width of each column is set which is less than the Panel size 
where extra space would be there on left side of the Table. LTR doesn't need 
getXPosition because it'll always be 0/attached to Panel at left position. In 
JTableHeader 
[r.x](https://github.com/openjdk/jdk/blob/6c5e15c1a291ca5ba1e4c3a90351bc71665ce988/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java#L399)
 is computed on this offset basis.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16374#discussion_r1399044562

Reply via email to