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

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.
 
You got style baby! More than 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