Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Event Listeners in Java Print Service API

 
Krishna Chhabra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to add the PrintJobListener to the PrintJob before you call print.

Darrin
 
andreas zeiner
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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





 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic