<Swing Dev> [12] RFR JDK-8210807:Printing a JTable with a JScrollPane prints table without rows populated
Phil Race
philip.race at oracle.com
Wed Jan 30 22:47:12 UTC 2019
755 if (g instanceof Graphics2D &&
756 !((g instanceof sun.print.PeekGraphics) ||
757 (g instanceof sun.print.PathGraphics))) {
You should test for the public interfaces .. I am not sure what you are
doing here
is going to do when we end up in banded printing which uses neither of
these
sun/swing/SwingUtilities2.java has this :
/*
* returns true if the Graphics is print Graphics
* false otherwise
*/
static boolean isPrinting(Graphics g) {
return (g instanceof PrinterGraphics || g instanceof
PrintGraphics);
}
you could perhaps make it public and call that.
-phil
On 11/12/18 3:36 AM, Prasanta Sadhukhan wrote:
> Hi All,
>
> Please review a fix for an issue where it is seen that a simple JTable
> doesn't print correctly if the table is contained in a JScrollPane.
> This is a regression of the fixJDK-8164032:
> <https://bugs.openjdk.java.net/browse/JDK-8164032>JViewport backing
> store image is not scaled on HiDPI display
> where JViewport's backing store image is scaled in the fix.
> It seems this scaling of backing store image is not needed for
> printing as the original backing store image or base image was printed
> correctly before this fix.
> Proposed fix is to check if the graphics object is been used for
> printing ie PeekGraphics/pathGraphics then skip this backing store
> image scaling.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8210807
> webrev: http://cr.openjdk.java.net/~psadhukhan/8210807/webrev.0/
>
> 8164032's manual regression testcase behaves in the same way before
> and after this fix.
>
> Regards
> Prasanta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20190130/24da7c60/attachment.html>
More information about the swing-dev
mailing list