Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A question on PrintJobListener interface

 
Andres Delrotti
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this code

PrintService service = PrintService.getDefaultPrintingService;
DocPrintJob job = service.createJob();


PrintJobListener pjlistener = new PrintJobAdapter() {
public void printDataTransferCompleted(PrintJobEvent e) {
System.out.println("Data transfer completed!");
}
public void printJobNoMoreEvents(PrintJobEvent e) {
System.out.println("No more events!");
}
public void printJobRequiresAttention(PrintJobEvent e) {
System.out.println("Requires Attention!");
}
public void printJobFailed(PrintJobEvent e) {
System.out.println("Print Job Failed!");
}
public void printJobCompleted(PrintJobEvent e) {
System.out.println("Print Job Completed!");
}
}


job.addPrintJobListener(pjListener);




The problem is, the only two events it seems to detect is printDataTransferCompleted() and printJobNoMoreEvents(). It could not detect the other remaining events even if I force those events to happen (ex: trying to print with printer case open, it should have seen the event printJobRequiresAttention() but it didn't).

Am I doing anything wrong? by the way I am using the TSP700II printer.

Thanks. Any form of help would be appreciated
 
Prakash Subramanian
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from the parentheses, is this right? . Its an interface and moreover the method too is not part of the interface. I guess its a typo.

Maybe the printer driver could be the problem. Did you try using a different printer or driver?
[ June 09, 2008: Message edited by: Prakash Subramanian ]
 
Paulo Carvalho
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am having the same problem. Did you resolved it?

Thanks

Regards
 
Campbell Ritchie
Sheriff
Pie
Posts: 49446
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please start a new thread. Look at this FAQ. Since the last post was in June, the poster might not realise you have replied.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49446
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to JavaRanch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic