This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Java in General and the fly likes printing: in general, copyArea specifically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "printing: in general, copyArea specifically" Watch "printing: in general, copyArea specifically" New topic

printing: in general, copyArea specifically

roger denton

Joined: May 03, 2003
Posts: 5
I'm attempting to enable printing of a JPanel that contains a mixture
of Swing and Java2D components.
In the JPanel->print method I have have code that seems to correctly calculate the portion of the JPanel that should be printed on a given call.
Now, for the broken/failing part...drawing the appropriate portion of the JPanel into the proper place in the Graphics context in the "print" method (g below).
//next line should copy the page of interest to 0,0 in g
g.copyArea(startX, startY, imageWidth, imageHeight, -startX, -startY);
The copyArea (JVM 1.4.2) fails with the following:
java.lang.InternalError: transformed copyArea not implemented yet
So, the question this a valid approach? Other suggestions to accomplish the goal?
Thanks in advance.
I agree. Here's the link:
subject: printing: in general, copyArea specifically
jQuery in Action, 3rd edition