• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Frame invoked on an Applet

 
Vardan Gupta
Greenhorn
Posts: 11
  • 0
  • 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.

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • 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
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • 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
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic