Printing using 1.1 API - big gray square in upper left

B

Bruce Feist

I'm trying to print using Java, for the first time. I decided to use
the 1.1 API because it's simple and adequate for the simple line drawing
I'm trying to display (a maze). I'm actually drawing on the Graphics
object received from the PrintJob directly, scaling my diagram to the
reported dimensions. The drawing is done with a series of
Graphics.setColor() and Graphics.drawLine() calls -- nothing else. The
only colors I set to are white and black, and the same routine that
draws to the page also is used to draw to a 400x400 JFrame's ContentPane
successfully.

It mostly works, the upper left corner of each 8.5" x 11" page is
obscured by a light gray square, measuring roughly 5" x 5". The square
only shows up when I draw to the printer -- not to the JFrame/ContentPane.

What on earth could cause this? Any ideas?

Thanks,
Bruce Feist
 
B

Bruce Feist

Bruce said:
the upper left corner of each 8.5" x 11" page is
obscured by a light gray square, measuring roughly 5" x 5".

Update: I tried this on two printers (different models), and got
identical results. So, I gave up on the 1.1-style printing, and rewrote
the code for 1.2 style instead. It works perfectly -- even though it's
using exactly the same underlying method for drawing on a Graphics
object that both the 1.1 version and the frame-based version do.

It's moot at this point, but I'd still like to know why I was getting
that square!

Bruce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top