RFR: 8236907: JTable added to nested panels does not paint last visible row

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Fri Feb 18 05:11:56 UTC 2022


On Thu, 10 Feb 2022 09:49:41 GMT, Tejesh R <duke at openjdk.java.net> wrote:

> Issue in painting last row of JTable due to decrement in `MaxRow `during computation. Differences in `MaxRow `computation between `TablePrintable` and `BasicTableUI `class. The Bug is fixed in both the classes. Test Case added to validate the same.

Changes requested by psadhukhan (Reviewer).

test/jdk/javax/swing/JTable/8236907/LastVisibleRow.java line 27:

> 25:  * @key headful
> 26:  * @bug 8236907
> 27:  * @summary  Verifies if Jtable last row is visible.

should be JTable

test/jdk/javax/swing/JTable/8236907/LastVisibleRow.java line 83:

> 81:             CaptureAfterClick();
> 82: 
> 83:             if (!compare(bufferedImageBefore, bufferedImageAfter)) {

You probably need to wait a little using robot.delay() after you capture the bufferedimage and then do the comparison.
I hope you have ran this test on CI on all platforms.

test/jdk/javax/swing/JTable/8236907/LastVisibleRow.java line 88:

> 86:         } finally {
> 87:             if (frame != null) SwingUtilities.invokeAndWait(() -> frame.dispose());
> 88:             if (dialog != null) SwingUtilities.invokeAndWait(() -> dialog.dispose());

I guess this "dialog" variable is not needed

test/jdk/javax/swing/JTable/8236907/LastVisibleRow.java line 131:

> 129:         centerPane.add(tablePaneContainer, BorderLayout.NORTH);
> 130:         contentPane.add(centerPane, BorderLayout.CENTER);
> 131:         frame.setSize(800, 600);

It will be good to center the frame on the screen by calling setLocationRelativeTo(null) so that in CI testrun is not affected, reduce the frame size also in that case..

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

PR: https://git.openjdk.java.net/jdk/pull/7422



More information about the client-libs-dev mailing list