Re: how to finish a java applet when I change of url in IExplorer

From: Andrew Thompson (SeeMySites_at_www.invalid)
Date: 02/05/05


Date: Sat, 05 Feb 2005 12:56:41 GMT

On Sat, 5 Feb 2005 11:54:58 +0100, Sebastian Scheid wrote:

> "davidgrs" <davidgrs@gmail.com> schrieb im Newsbeitrag
> news:1107533710.720107.67560@l41g2000cwc.googlegroups.com...
>>I have a problem with a java applet that has inside a thread, when I
>> change of page, the java applet is still runing, and then when I load
>> another page tha cotaints this java applet, I have two instances
>> running in my internet explorer.
>>
>> I am aware of this because my java application uses tcp sockets
>> communications, and the tcp activity is still alive when I changed of
>> paged in the Internet Explorer.
>
> Did you override the stop()-method? You should stop the communication and
> the thread there. Be aware that stop is called when loading another page,
> quitting the browser or minimizing the browser window.

Be aware that while compatible browser/VM combinations are
*supposed* to call the stop() method on page exit, many don't.

You can never absolutely rely on stop() being called.

To the OP. You might be able to get around this problem by
applying the singleton design pattern here. Only one instance
of the applet will exit in any one VM.

Of course, if a browser choses to load mulitple VM's, all bets are
off, and you are better off to check for the original socket being
occupied to trigger an error/information message.

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane


Relevant Pages

  • Re: C++ Program
    ... > applet and let the Java applet execute the C++ program? ... > be run in a browser. ... I already have a website and a web host. ...
    (microsoft.public.frontpage.programming)
  • Re: Internal IP exposed
    ... > I disabled the script execution of Java applets in my browser (Internet ... The java applet appears to open a connection to www.testmyfirewall.com on ...
    (comp.os.linux.networking)
  • Re: how to finish a java applet when I change of url in IExplorer
    ... >I have a problem with a java applet that has inside a thread, ... > communications, and the tcp activity is still alive when I changed of ... quitting the browser or minimizing the browser window. ...
    (comp.lang.java.programmer)
  • Re: Graphics in a browser
    ... the phrase 'A Simple Process Map' turns out to be just that). ... browser. ... Java applet, Flash, SilverLigth. ... Doing it with JavaScript pre-HTML 5 may be possible ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: chat channel
    ... I know Crash and I know kal and I know about the GoogleBot, but I don't really know some of the other folks who occasionally sign in and just sit there. ... a java applet. ... not in a browser) would be any better. ... regular desktop IRC client, ...
    (rec.food.cooking)