On Mon, 14 Feb 2022 06:53:18 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
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.
>
> 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......

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

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

Reply via email to