its called twice because the first call is a "peek" to see what kind of
rendering you are doing. So that is normal and not a problem.
One possibility for one pixel difference in the user clip is because
of a some floating point rounding error given the different transforms
between the "peek" (default transform) and the actual printing call (when
the transform scales to printer resolution).
But I doubt that would affect your printing and certainly Swing
component UIs do print just fine.
-phil.
> Date: Fri, 11 May 2001 14:21:57 -0400
> From: Himabindu Kosuru <[EMAIL PROTECTED]>
> Subject: [JAVA2D] Problems with 2D printing
> Comments: cc: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
>
> Hi All,
>
> I have some printing code that works properly in JDK1.1.8. When I moved
> the code to 2D printing, the components are not printing properly. I
> print multiple components on the same page. I use setClip() and
> translate() methods on the graphics objects a lot. One thing I noticed
> is the print() method on my Printable implementation is called twice for
> every pageIndex although the number of copies is set to 1. When I
> printed out the clipBounds in the middle of the code, I noticed that
> there is a difference of 1 pixel between the first call and the second
> call for the same pageIndex. Are there any known problems with setClip()
> and translate() methods? Why is the print() method getting called twice?
> I tried in both JDK1.3 and JDK1.3.1.
>
> Thanks,
> Himabindu
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".