2

When I try to use Group Layout Manager in my applet it gives me this odd exception: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)

When I don't use a layout manager (null) it works fine. To see the whole trace dump go to nuevawave.org/sandbox/JavaGallery/GUIApplet.html and right click somewhere in the top left. If I use absolute layout, there is nothing to click on. The jar is at nuevawave.org/sandbox/JavaGallery/GUIApplet.jar. Any help is appreciated. Thanks.

I don't know if this will help, but here is the applet code:

<applet Archive ="TestApplet.jar,swing-layout-1.0.4.jar"
      Code="test.GUIApplet"
      WIDTH="500" HEIGHT="300"
</applet>

1 Answer 1

2

You receive this Exception because the GroupLayout uses Reflection (thus the "RuntimePermission accessDeclaredMembers"). Reflection is considered too powerful for unsigned applets, so the only chance you have is to either sign your applet or use a different layout manager.

Sign up to request clarification or add additional context in comments.

2 Comments

I used the jarsigner to sign the applet, but I still get the Runtime permission error. Do I have to do something with the html too?
No, but you have to sign all the Jars involved with the same certificate, so you should sign the swing-layout Jar, too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.