This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Posted by Kishori Sharan on August 29, 2000 at 4:44 PM
Applet with swing components is not working in IE on my PC. So I cannot have two applets running in mt IE to test them. That is why, I cannot give you any sample code. I am giving you some hints which will be helpful to get it work the way you want.
1. Applet is started and stopped by Browser , so I think you may have to override the start method of your applet and call the super method based on some flag when you need to start it.
2. You can get the reference of another applet from an applet on a HTML page as follows. I suppose you are writing your code within your applet, so that applet reference is understood.
AppletContext ac = this.getAppletContext ( ) ;
Applet2 = ( Applet2 ) ac.getApplet ( "appname" ) ;
// Here appname is the name of the applet tab you give in HTML page to your second applet. YOu can set the NAME attribute of an applet within applet tag in HTML page.
3. Once you have the reference of your second applet then you can do whatever, you want to with that object.