I am Learning Java Step by Step From Herbert Schildt Book Java2 Complete Reference Fifth Edition. On my way to creating simple Banner Applet which Display\'s Banner and Scrolls
Applets, by default, run in a sandbox environment with restricted permissions because of security reasons. Applets do not have runtime permissions to create or modify thread groups and hence you are getting the exception. Do not create a new thread group. Or else override your security policy to explicitly allow your applet to create one by granting the runtime permission to create or modify thread group. To override default permissions define appropriate policy in your user home's .java.policy file. It is recommended that you edit your user specific policy file and not the global policy file under your JRE security directory.
Use a JDK's policy tool to define the policy or do it manually. Refer the template below:
grant codeBase "<code base>" {
permission <type> "<target>", "<actions>";
permission <type> "<target>", "<actions>";
...
};
For eg.
grant codeBase "http://geosim.cs.vt.edu/geosim/-" {
permission java.lang.RuntimePermission "modifyThreadGroup";
...
};