wood burning stoves 2.0*
The moose likes Applets and the fly likes How to kill an applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "How to kill an applet" Watch "How to kill an applet" New topic
Author

How to kill an applet

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
I want to know how to kill an applet besides using stop and destroy method of an applet?
Thanks
Angela
David Kane
Ranch Hand

Joined: Sep 20, 2001
Posts: 65
You could close the browser window that contains the applet.
Dave
------------------
David Kane
david_kane@houseofyin.com
Author of Software Architecture: Organizational Principles and Patterns
http://www.vraps.com
http://www.houseofyin.com


David Kane<BR> <A HREF="mailto:david_kane@houseofyin.com" rel="nofollow">david_kane@houseofyin.com</A> <BR>Author of <A HREF="http://www.amazon.com/exec/obidos/ASIN/0130290327/ref=ase_electricporkchop/103-0514572-3811868" TARGET=_blank rel="nofollow">Software Architecture: Organizational Principles and Patterns</A><BR><A HREF="http://www.vraps.com" TARGET=_blank rel="nofollow">http://www.vraps.com</A><BR><A HREF="http://www.houseofyin.com" TARGET=_blank rel="nofollow">http://www.houseofyin.com</A>
Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Thanks,
I don't want to close browser.
Is there any other way???
Thanks
Angela
Abhinav Sharma
Greenhorn

Joined: Aug 08, 2001
Posts: 25
Hi anu,
oops sorry there was a mistake i by mistake wrote a wrong sentence which i am correcting
Well yes there is one more way through which you can close the applet for that you have to use policytool. You have to give full access through policytool and then it work like frames where you can close the window by System.exit(). and can close the the applet by using System.exit(). But it work if you are using it outside a browser for closing the applet inside a browser you have to use javascript function. That is window.close(). I hope this helps you.
abhinav
[This message has been edited by Abhinav Sharma (edited November 22, 2001).]
Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Abhinav,
Thanks a lot for your information.But in this solution is there anything client has to do regarding policy tool when he will use our product?
Thanks
Angela
Abhinav Sharma
Greenhorn

Joined: Aug 08, 2001
Posts: 25
Hi anu,
Well no the client has nothing to do with this. Actually i have never tried this on server. I have used Applets only on client side. The only thing i have used on server is jsp. But policytool gives the code permission to behave like frames. I think you can try it on server and see what results it gives. So you better try it out. I think this way you may get to learn other things and if you have any problem you can visit this url where you can learn lot of things about policy tool from where i have learned. The url is "http://java.sun.com/products/jdk/1.2/docs/tooldocs/solaris/policytool.html"
I hope this solves your problem.
abhinav

[This message has been edited by Abhinav Sharma (edited December 02, 2001).]
Rakesh Ray
Ranch Hand

Joined: Jul 25, 2001
Posts: 51
If you are facing following condition....

3.13: What is the cause of this message: applet did not shutdown in 30 secs--killing it?
Usually this happens when the applet which is destroyed has threads running. The solution is to create the destroy() method and stop and destroy all applet's threads.
Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Yes, I am getting this message
applet did not shutdown in 30 secs--killing it? in Netscape 4.04.
I have HTML with five buttons, When user clicks on one button to another button, I used the same applet. Only the differnce is that when user click on one button to another button, applet close and start again. In this phenomenon, Browser doesn't call destroy method of an applet....
What is the solution of it?
Thanks,
Angela
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
hi all,
this is sort of wiered solution. u can 've DHTML and put ur applet in say HTML Table. overwrite that column 'ving the applet with innerHTML = ""

i've not tried this but if we just want to close the applet this should serve our purpose i guess (i 've not thought that how would i get an application in which if we press different buttons applet gets restarted).
regards
maulin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to kill an applet
 
Similar Threads
Soap thread
WA #1.....word association
not able to kill JVM
System.exit(0) in destroy()
got error while running weblogic from the unix environment