This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Event Listeners in Java Print Service API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Event Listeners in Java Print Service API" Watch "Event Listeners in Java Print Service API" New topic
Author

Event Listeners in Java Print Service API

Krishna Chhabra
Greenhorn

Joined: May 15, 2007
Posts: 9
For error handling in printing, i have implemented the PrintJobListener interface, but its strange that even if the printer is out of paper or the printer tray is open, the method printJobRequiresAttention(PrintJobEvent pe) of the above interface is not handling the above error. Even the System.out.println(..) statement inside this method is not getting executed.

Darrin Cartwright
Ranch Hand

Joined: Dec 27, 2002
Posts: 107
I think you need to add the PrintJobListener to the PrintJob before you call print.

Darrin


Life is good on the Ponderosa,<br />but mind where you step.
andreas zeiner
Greenhorn

Joined: May 29, 2007
Posts: 1
hi

i have a similar problem with some sample code - there a printjoblistener is implemented but nothing happens.

what i want is that when the printer runs out of paper during a printjob that an error occures or if there is any kind of failure like printer is off that the failure is reported back to the user e.g. over a jsp.

is this even possible ?

here is the sample code - maybe someone can give me a hint





 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Event Listeners in Java Print Service API