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!
Printable View
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!
If the window is a Frame, call 'dispose()'.
Hi,Jason:
The window is applet window not in the frame.
Hi, Jason:
My project is applet window not in the frame.
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();
}