Hello all,

I have the following exception: java.security.AccessControlException: access denied (java.io.FilePermission blahblah.. myfile.gif read etc...

my code: JButton myButton = new JButton(new ImageIcon("myfile.gif"));

I added the ff to my java.policy file

grant codeBase "my domain-" {
permission java.security.AllPermission;
permission java.io.FilePermission "<<ALL FILES>>", "read, write";
};

No go :(

Did I miss something?

This is just a temporary thing, what I would like ideally is that my applet runs smoothly without having to change the java.policy file for every client :P How do I do that? I've read about signing applets, etc but I'd rather not do that.. is there any other way?

Thanks a lot!

The way you're doing it it won't work over a network anyway as you're trying to pull your graphics from the machine that's running the browser...

Pack everything in a jar file and pull the graphics from that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.