I’m using JNLP to print some images inside an applet. I pass a Printable object to a javax.jnlp.PrintService instance and call PrintService.print(). Is there any way to know when this operation completes?
Looking at line 116 of the PrintService source code, it seems to start a thread for printing and not attach anything to keep track of it.
There seems to be mechanisms for tracking print operations in other parts of Java, but I have not had success using other printing mechanisms in the context of a browser applet. (the user is constantly nagged about security)
Is it possible to print something in a signed java applet, not have the user be nagged about security, and know when the print operation finishes?
I managed to solve this problem by switching from using
javax.jnlp.PrintServiceto usingjavax.print.PrintService. Using the later allows you to attach a PrintJobAdapter to monitor the status of the print job. See this Stack Overflow question.All of this is perfectly acceptable in a JNLP deployed applet, provided the applet is signed.