Sometimes you need to allow two or more applets to communicate on the Web page.
Because the applets all run within the same Java context-that is, they are all in the same virtual machine together-appletscan invoke each other\'s methods.
The AppletContext class has some methods for locating another applet by name, or retrieving all the applets in the currentruntime environment. The AppletContext class in the java.applet package contains the two member functions getApplet and getApplets.
By using these functions, an applet can find other applets and invoke methods on them.
Example:Html file: Using the name attribute, you can refer to a applet: Applet anotherApplet = getApplet(\"applet1\"); anotherApplet.someMethod(); //calling any public method