File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Java Print Dialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Print Dialog" Watch "Java Print Dialog" New topic

Java Print Dialog

Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492

Am using the below code to print the txt files. But its not showing print dialog, By default its printing in default printer

Someone please assist me, how to invoke the print dialog using below code.

Steve Luke

Joined: Jan 28, 2003
Posts: 4181

Have you looked at the java.awt.print API, specifically the PrintJob? There is also a Printing lesson in the Tutorials.

Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
Steve thanks for replying. I seen all these tutorials nothing helps me. awt is not working in my case, the only code support for my case is as I submitted above
Need the Print Dialog for that code. Please help

Any way to merge below code in the above method to display print dialog, Please assist

PrinterJob pj = PrinterJob.getPrinterJob();
I agree. Here's the link:
subject: Java Print Dialog
It's not a secret anymore!