• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use Policytool in the Applet?

 
Daniel Washington
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use a gif picture in my applet,and put the gif and the myapplet.class in the same directory,it is ok!
but when i move the gif picture to another directory,i don't know how to use the policytool in window2000,it always show "can not access the C:\\??\\??\\??.gif",how could i deal with it?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Applets forum...
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Daneil
I guess you currently don't need Policy Tool if you are not getting SecurityException but I have some ideas,
1. You should prepare a JAR file for the applet where you put your appelt
2. You should put your images in that JAR file and access it using this.getClass().getResource("/myimage.gif"); wherever you want to use it
3. You should avoid accessing image on the local machine's Absolute path as the applet won't work when you upload it to the server and then from there access it via the browser as you can't know (or enforce) actual path to that image anymore..
This way you will avoid future problem and current as well I guess...
Let us know if this getResource() thing seems monster to you..
Regards
Maulin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic