Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HELP!!!!!!

 
rafa rodri
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im trying to set an icon into a label, in an applet, but
it displays this message: java.security.AccessControlException: access denied (java.io.FilePermission c:/piledriver.gif read)
i dont know what i should do, could anyone help me?
thanxs
 
Torsten Schippel
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi rafa,
Your applet needs the right permissions or it needs to be signed. By default you cannot read a file from local file system (Sandbox).
You can use Applet.getImage(URL url) to get the image from your server.
Or you can put the image in the jar file and get it with
URL url = this.getClass().getResource("icon.gif");
Image image=Applet.getImage(url);
Regards
Torsten
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!