Two applets in the same web page

From: JFA (jfaba_at_free.fr)
Date: 08/30/04


Date: Mon, 30 Aug 2004 17:45:14 +0200

Hi
I'm a french beginner in Java, so please forgive my poor knowledges and my
poor english.
I made an applet and put in in a jar file (named myjar.jar)
I wrote html like : <applet ... archive=myjar.jar> with some parameters.
In my applet I get these parameters with getParameter() and put them in
global variables :

I have a class named MyGlobalClass with static fields :
class MyGlobalClass{
    static String myField;}
and :
    MyGlobalClass.myField = getParameter(paramName);

Something strange happens :
When I run one instance of the applet at a time it works fine.
But when I run 2 instances of that same applet in the same html page with
different parameters these two instances seem to interfere with each other.
I wander if the the global variables of an applet are shared in the
computer.
What could I do to preserve the values of the variables of each instances ?
May be it is because I didn't override the stop method in my applet ?
Thank you for response
JFA