RFR: 5108458: JTable does not properly layout its content [v13]
Andrey Turbanov
aturbanov at openjdk.org
Sat Dec 2 20:58:46 UTC 2023
On Fri, 1 Dec 2023 09:26:41 GMT, Tejesh R <tr at openjdk.org> wrote:
>> Table contents does not follow right-left Orientation when Max width of columns are set. This is due to not considering the offset in `x position` while painting table grid and table cell. The fix handles the offset and adjust the x position for each paint, similar to how header is painted. The fix is applied to both Basic and Synth Look and Feel.
>> The fix is verified for all Look and Feel manually and test verifies on Metal L&F since automatic test cannot be generalized throughout other Look and Feel.
>> CI tested is green for regression check and test check.
>
> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
>
> Review fix
src/java.desktop/share/classes/javax/swing/JTable.java line 3009:
> 3007: else {
> 3008: TableColumnModel cm = getColumnModel();
> 3009: for(int i = 0; i < column; i++) {
Suggestion:
for (int i = 0; i < column; i++) {
src/java.desktop/share/classes/javax/swing/JTable.java line 3016:
> 3014: // adjust the x coordinate for this case.
> 3015: final int columnWidth = cm.getColumn(column).getWidth();
> 3016: if( !getComponentOrientation().isLeftToRight() ) {
Suggestion:
if (!getComponentOrientation().isLeftToRight()) {
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16374#discussion_r1412872414
PR Review Comment: https://git.openjdk.org/jdk/pull/16374#discussion_r1412872472
More information about the client-libs-dev
mailing list