Hi !

When I try to run this from an applet:
URL df = getCodeBase();
iconReport = new ImageIcon( new URL( df, "images/i_report.gif"));

I Get:
Java.security.AccessControlException: access denied (java.io.FilePermission
images/i_report.gif read)
 at java.security.AccessControlContext.checkPermission(Unknown Source)
 at java.security.AccessController.checkPermission(Unknown Source)
 at java.lang.SecurityManager.checkPermission(Unknown Source)
 at java.lang.SecurityManager.checkRead(Unknown Source)
 at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
 at sun.awt.SunToolkit.getImage(Unknown Source)

But in another place in the code I have:
df = new URL( getCodeBase(), "stntree.dat");
BufferedReader  in = new BufferedReader( new InputStreamReader(
df.openStream(), "UTF-16"));

And this works fine without any problems, I thought it had something to do
with the images subdirectory, but even if I put the gif files in the same
directory as the applet it does not work.

Is there anything special I have to do to read an icon ?

(Windows2000 and Tomcat 4.0)

Mikael




Reply via email to