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

Tejesh R duke at openjdk.java.net
Wed Feb 16 09:16:12 UTC 2022


On Tue, 15 Feb 2022 08:28:58 GMT, Tejesh R <duke at openjdk.java.net> wrote:

>> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java line 1903:
>> 
>>> 1901:     private void paintDropLines(Graphics g) {
>>> 1902:         JTable.DropLocation loc = table.getDropLocation();
>>> 1903:         if (loc == null) {
>> 
>> Deleting this seems to have regressed JDK-8081491 where 1 extra row is printed per page..
>> jdk/test/java/awt/print/PageFormat/ImageableAreaTest.java is supposed to print 35 rows which was visible in console but it prints 36 rows..
>
> The mentioned test computes 36 rows for frame height of 600 units. The 36th row is 18% visible in console and in printing its 100% visible. I have done the testing for the bug fix with an automated test case LastRowVisible.java and with the below test cases.
> 1. jdk/test/java/awt/print/PageFormat/ImageableAreaTest.java
> 2. jdk/test/javax/swing/JTable/LostTextTest.java
> 3. test/jdk/javax/swing/JTable/TestClearSel.java
> The maxRow computations are just fine for console and printable views, the only thing is visibility of the same when setSize of frame is not a multiple of rowHeight of a table......

Tested for the below test cases:
1. jdk/test/javax/swing/JTable/PrintManualTest_FitWidthMultiple.java
2. jdk/test/javax/swing/JTable/JTableScrollTest.java
3. Also with SwingSet2 application for verification of JTable console paint and printing.

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

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



More information about the client-libs-dev mailing list