This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Applets and the fly likes HELP!!!!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "HELP!!!!!!" Watch "HELP!!!!!!" New topic


rafa rodri

Joined: Sep 24, 2003
Posts: 1
im trying to set an icon into a label, in an applet, but
it displays this message: access denied ( c:/piledriver.gif read)
i dont know what i should do, could anyone help me?
Torsten Schippel
Ranch Hand

Joined: May 09, 2003
Posts: 62
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);
It is sorta covered in the JavaRanch Style Guide.
subject: HELP!!!!!!
It's not a secret anymore!