Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Printing using 1.1 API - big gray square in upper left

Thread view: 
Bruce Feist - 25 Oct 2006 03:22 GMT
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
Bruce Feist - 26 Oct 2006 03:47 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.