• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use applet to do print job

 
happyjava
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

when I use applet to print a table,I use the class java.awt.print.PrinterJob.
but when I reference it I got the accessPermission expception ,say that I can not use the class. I know that the PrinterJob class use the local os's print driver,so it violate the applet restriction .
How I can make it ?
thanks
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to create a signed applet with a rule in it that allows access to printing.
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I think all the literature says to do so. But I was not able until now to do what Tim suggests. I played around with polycies and the like, with some succes. But making an Applet with an rule , e.g. allow printing on a 'foreign' printer, how....
The first time is sometimes so difficult.
Maybe someone tells us the steps to make a signed applet
for e.g. using a local printer???
 
peter johansson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I stumbled into this page that explains the steps to take in order to sign an applet.
http://java.sun.com/security/signExample12/
I hope it can be of some use.
regards,
/Peter (Sun Certified Java Programmer)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic