Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Instantiating a JFrame in a JApplet  (exception java.security.AccessControlException)

Thread view: 
Z - 20 Feb 2007 17:46 GMT
I've created a JFrame (name: SalesEntryForm) in my visual designer
(NetBeans).

When I try to instantiate that JFrame within my JApplet's start() or
init() method:
 SalesEntryForm entryForm = new SalesEntryForm();

I get this error:
 exception: java.security.AccessControlException: access denied
(java.lang.RuntimePermission exit VM.0)

Oddly, I can instantiate a simple JFrame without error:
 JFrame entryForm = new JFrame();

What's going on?!  What am I doing wrong?

How do I remedy this error?

Also, what's the most efficient way to debug a JApplet? I'm resorting to
trial and error because I haven't found a way to run a JApplet in the
IDE debugger.
Andrew Thompson - 20 Feb 2007 17:52 GMT
> I've created a JFrame (name: SalesEntryForm) in my visual designer
> (NetBeans).
[quoted text clipped - 6 lines]
>   exception: java.security.AccessControlException: access denied
> (java.lang.RuntimePermission exit VM.0)

An applet is not allowed to cause the VM
to exit.  Since you 'control' the code,
you might change the exit behaviour of the
JFrame to not attempt to end the VM on close.
(There are other more kludgy alternatives,
if you do not control the code.)

Andrew T.
Z - 20 Feb 2007 18:33 GMT
>> I've created a JFrame (name: SalesEntryForm) in my visual designer
>> (NetBeans).
[quoted text clipped - 13 lines]
> (There are other more kludgy alternatives,
> if you do not control the code.)

That was it. I just had to change the defaultCloseOperation.

Thank you. I would have never found that.
mickey - 20 Feb 2007 17:53 GMT
> I've created a JFrame (name: SalesEntryForm) in my visual designer
> (NetBeans).
[quoted text clipped - 17 lines]
> trial and error because I haven't found a way to run a JApplet in the
> IDE debugger.

hi...
first of all before resolving this problem ..the thing id which layout
r u using ....or "Set Bounds"???

TRY TO USE CONTENT PANE ..
in CONTENT PANE FIT YOUR COMPONENTS

i may b wrong ..plz refer Sun Java Tutorial or download it from sun's
site..
ok


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.