October 7th, 1999, 09:58 AM
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.
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.