Click to See Complete Forum and Search --> : applet window close
March 6th, 2000, 01:46 PM
Hi,
Hi, friends:
I am new to java.
I have quit button in an applet. Can somebody tell me what method can be used to close an applet window if quit button press?
thanks in advance!
Jason Teagle
March 6th, 2000, 02:38 PM
If the window is a Frame, call 'dispose()'.
March 6th, 2000, 02:54 PM
Hi,Jason:
The window is applet window not in the frame.
March 6th, 2000, 02:55 PM
Hi, Jason:
My project is applet window not in the frame.
poochi
March 6th, 2000, 06:36 PM
If you are running ur applet using applet viewer , then you can close the
applet viewer window. But if you run it inside a browser , you cant do it in pure java.
check out http://www.nevaobject.com/java/index.htm
If you use appletViewer :
Component c = applet;
while( ( c != null ) && !( c instanceof Frame )) c = c.getParent();
if( (c != null )&& (c instanceof Frame ) ){
applet.stop();
applet.destroy(); // I dont know whether these two lines are necessary.
((Frame) c ).hide();
((Frame) c ).dispose();
}
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.