To access the printer (or any resource on the host computer), the jar file containing the applet code must be signed, and the user must accept the signer as a trusted party. To sign the jar file, use the jarsigner program, which is part of the JDK. Jarsigner uses its own keystore, so if you have your own certificate, you must first import the certificate into the keystore. It can also create certificates if you do not have another certificate to sign the jar file.
The jarsigner tool documentation can be found here.
Note that the newer Java runtimes ask the user if they are allowed to access the printer, but I found that regardless of the answer, the code in the unsigned jar file cannot access the resources.
Lacek source share