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 Swing / AWT / SWT and the fly likes background printing 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 » Swing / AWT / SWT
Bookmark "background printing" Watch "background printing" New topic

background printing

james murphy

Joined: Aug 28, 2003
Posts: 1
did anybody know how to initiate print in background using Java Printing API.
I would like to print JPanel without showing in the Jframe
My requirement is I need to write some text to Jpanel and Print the JPanel without showing to user.
or is there any alternative ? I mean if you have some text with you if you want to print it without
showing what is the best way to do it?.
I am using Swing as my UI.
Any Ideas greatly appreciated
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
If your requirement is not to display the print dialog, use the following code
JobAttributes jobAttributes = new JobAttributes();
frame.getToolkit().getPrintJob(frame, jobtitle, jobAttributes, pageAttributes);
I agree. Here's the link:
subject: background printing
jQuery in Action, 3rd edition