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

Alexey Ivanov aivanov at openjdk.org
Wed Nov 22 12:19:14 UTC 2023


On Wed, 22 Nov 2023 07:04:01 GMT, Tejesh R <tr at openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java line 2108:
>> 
>>> 2106:                         paintCell(g, cellRect, row, column);
>>> 2107:                     }
>>> 2108:                     cellRect.x += columnWidth;
>> 
>> This is weird… if we paint columns in right-to-left order, x should decrease.
>
> Here, we are painting from left-to-right order by starting with last column. It is only a convention, I guess painting this way is more simple that to actually paint from `right-to-left`. Here for both the orientations, we are painting from left-to-right, only difference is how we pick the columns.

Okay… So, you changed the painting order as well, it now paints from the last column to the first in the right-to-left orientation, does it? This is why the code inside the loop is the same now.

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

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


More information about the client-libs-dev mailing list