|
-
October 7th, 1999, 09:58 AM
#1
How does an application kill itself?
Hi. I've written a java program which can be run as either an applet or application (nothing special there ;-))
I have a "close" button on my main window, which I'd like to grey out if it's running as an applet, but enable if running as an application.
If the user presses it while running as an application I'd like to terminate my program immediately.
Q1: I was going to check if it's running as an app or applet by setting a flag in the init and main functions. Is this the best way or is there a runtime function I can call? I would prefer a runtime function.
Q2: How do I tell my application to close immediately? Calling destory does not seem to do anything.
Any help would be gratefully appreciated.
Thanks,
Tom.
-
October 7th, 1999, 10:04 AM
#2
Re: How does an application kill itself?
> How do I tell my application to close immediately? Calling destory does not seem to do anything.
Call "System.exit(0);"
I dont have answer for your first question. There are lots of complicated solution for your
first question. I will post it later. ( One suggession is , getAncestorParent() and do
toString() with the return value and check what you are getting for both Frame and Applet ).
Poochi
-
October 7th, 1999, 10:10 AM
#3
Re: How does an application kill itself?
Works great!
Thanks a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|