Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Applet not running

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to run this applet and am getting this error message: Exception in thread "pool-1-thread-1" java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")

I'm created the html file for the applet and in addition added the comment //<applet code = "NotPong.class" width = 400 height = 200> </applet> at the top of the applet. I've also tried to edit the java.policy file with the policy tool by adding  permission java.lang.RuntimePermission "modifyThreadGroup";

There shouldn't be anything wrong with the applet itself because it's from a book but I have no idea why it is not running. Any ideas?



 
Master Rancher
Posts: 3845
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What program are you using to execute the applet?
It works for me in AppletViewer.
 
Saloon Keeper
Posts: 12129
258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets are a mostly deprecated technology. Is there a good reason to keep using them? Most browsers drastically limit what an applet is allowed to do.
 
Josh Diamond
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Norm Radder wrote:What program are you using to execute the applet?
It works for me in AppletViewer.



Using appletviewer.
 
Norm Radder
Master Rancher
Posts: 3845
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's in your .java.policy file?

Mine has these lines near the front:

Aother possibility: use a private policy file:

mypolicy.policy:

Command line:


"C:\Program Files\Java\jdk1.8.0_60\bin\appletviewer.exe" -J-Djava.security.policy=mypolicy.policy NotPong.java


 
It's feeding time! Give me the food you were going to give to this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic