<Swing Dev> [9] RFR: JDK-8170349: The printed content is beyond the borders.

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Wed Nov 30 09:23:31 UTC 2016


Hi All,

Bug: https://bugs.openjdk.java.net/browse/JDK-8170349

webrev: http://cr.openjdk.java.net/~psadhukhan/8170349/webrev.00/

Please review a fix for a continuation/regression of JDK-8081491 
<https://bugs.openjdk.java.net/browse/JDK-8081491> in which we made sure 
that we print only the JTable rows/columns that is visible on console.

This bug manifests itself as, despite marking JTable PrintMode to 
FIT_WIDTH, we are printing only those columns that are visible on console.

However, if JTable PrintMode is FIT_WIDTH, then as per spec
https://docs.oracle.com/javase/8/docs/api/javax/swing/JTable.PrintMode.html#FIT_WIDTH
we should print all columns on each page (apparently irrespective of 
what is visible)

The fix takes care of that by making sure the table bounds is adjusted 
to clipwidth [which is already adjusted to total column width here 
<http://hg.openjdk.java.net/jdk9/client/jdk/file/f7148ccb86bb/src/java.desktop/share/classes/javax/swing/TablePrintable.java#l504>]
so that all columns are printed and also rectangle border is drawn 
encompassing all columns.

The 8081491 testcases passed with this fix as well.

Regards
Prasanta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20161130/6a3f9062/attachment.html>


More information about the swing-dev mailing list