0

I have a simple Applet application and my code creates ImageIcon objects from the same url from the Applet. When I run the application, I get a message about unrestricted access, it scares the user.

How I configure my Applet or my JNLP to only show specific restriction messages?

Edited After all, I refactor my code and find ways to load image correctly. To load image from JAR: http://docs.oracle.com/javase/tutorial/uiswing/components/applet.html#images. To load image from Applet: imageIcon = new ImageIcon(getImage(getCodeBase(), "image/image_name.png"));

Marcus Becker
  • 352
  • 4
  • 11

1 Answers1

2

How I configure my Applet or my JNLP to only show specific restriction messages?

Beyond the more specific permissions shown for the JNLP API services, Java does not offer any finer permission gradations than all-permissions, j2ee-application-client-permissions or sand-boxed (no security element).


However it seems this warning is seen due to a bug linked by the OP.

Netbeans Bug 227169 - java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • Andrew, do I need add permission for this? *... URL url = new URL(codeBase, imageName); return new ImageIcon(url); ..* For example, my applet run on *http://www.mvbos.com.br/blank_colony/* and I try to loag image from *http://www.mvbos.com.br/blank_colony/image/* – Marcus Becker Apr 09 '13 at 01:46
  • That should work in a sand-box, so long as `imageName` is not something ridiculous. – Andrew Thompson Apr 09 '13 at 23:47