Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Frame invoked on an Applet

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to make an applet which invokes a frame, and frame is implementing WindowListener and ActionListener but it gives an exception
Exception in thread "AWT-EventQueue-1" java.security.AccessControlException
the coding done in listener is {System.exit(1);}
please help me out, i m a beginner in java.

 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the full stack trace of the exception.

You can't attach source files, you'll need to post a relevant excerpt here. Be sure to use CODE tags for any code you post.
 
Vardan Gupta
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Vardan Gupta wrote:I was trying to make an applet which invokes a frame, and frame is implementing WindowListener and ActionListener but it gives an exception
Exception in thread "AWT-EventQueue-1" java.security.AccessControlException
the coding done in listener is {System.exit(1);}
please help me out, i m a beginner in java.

 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, quoting your entire previous post without adding any new information didn't exactly make things clearer, but do you mean to say you're calling System.exit() in an applet? If so, that's neither allowed, nor would it work if it was allowed. The JVM is under the control of the browser, not the applet. What are you trying to achieve by calling that method?
 
Vardan Gupta
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
leave all that, i just want to ask one thing that, if we use System.exit(1) as a body in any funcion then all the opened frames get lost, but suppose if we are having 1 applet window opened and 1 frame window opened in the same program and we are using aforesaid then there arise a problem, which i mentioned in my previous post.
Thanks
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:you're calling System.exit() in an applet? If so, that's neither allowed, nor would it work if it was allowed. The JVM is under the control of the browser, not the applet.


If you want to close windows, then you'll have to keep references to them so that you can call their dispose() method at appropriate times.
 
straws are for suckers. tiny ads are for attractive people.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic