• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A question on PrintJobListener interface

 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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

Thanks

Regards
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to JavaRanch
 
It's feeding time! Give me the food you were going to give to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic