RFR: 5108458: JTable does not properly layout its content [v5]

Prasanta Sadhukhan psadhukhan at openjdk.org
Tue Nov 21 03:47:11 UTC 2023


On Mon, 20 Nov 2023 10:08:42 GMT, Tejesh R <tr at openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java line 2102:
>> 
>>> 2100:                 cellRect = table.getCellRect(row, cMin, false);
>>> 2101:                 cellRect.x = getXPosition(cMax);
>>> 2102:                 for (int column = cMax; column >= cMin; column--) {
>> 
>> Is there any reason for choosing to paint from cMax to cMin ie from left-to-right in RTL orientation
>> when it was done from right-to-left before your fix? 
>> I guess painting from right-to-left also should work with cellRect.x -= columnWidth ie with no change in code, no?
>> 
>> One more q,
>> If there are 5 columns, then is it that for LTR cMin is 1, cMax 5 and for RTL cMin is 5 , cMax 1 or viceversa?
>
> Yes, we can either paint from right-to-left or from left-to-right. I followed `JTableHeader ` paint logic.  for 5 columns cMin = 0 and cMax = 4.

For both LTR and RTL?

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

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


More information about the client-libs-dev mailing list