What is Inter Applet Communication ?
Inter Applet Communication means the communication of applets to each other in the same browser running simultaneously.
Lets understand it by an example:
suppose if there are 2 applets running in the browser that are applet1 and applet2.
Now suppose we want that when we click on the applet1's button then a message should be displayed on applet2
by using Inter Applet Communication we can do that thing and all those things that are related with the applet's communication.
Now the question is how can we do that?
so java.applet.AppletContext class provides the facility of communication between applets.
we provide the name of applets in the html file and by using this particular name with getApplet() method we can access the particular applet.
Syntax of getApplet() method:
public Applet getApplet(String appletName);
Program
first I am creating the html file named iac.html
<html>
<head>
<title>inter applet communication</title>
</head>
<body>
<applet code="Applet1.class" width="1000" height="500" name="applet1">
</applet>
<hr/>
<applet code="Applet2.class" width="1000" height="500" name="applet2">
</applet>
</body>
</html>
Inter Applet Communication means the communication of applets to each other in the same browser running simultaneously.
Lets understand it by an example:
suppose if there are 2 applets running in the browser that are applet1 and applet2.
Now suppose we want that when we click on the applet1's button then a message should be displayed on applet2
by using Inter Applet Communication we can do that thing and all those things that are related with the applet's communication.
Now the question is how can we do that?
so java.applet.AppletContext class provides the facility of communication between applets.
we provide the name of applets in the html file and by using this particular name with getApplet() method we can access the particular applet.
Syntax of getApplet() method:
public Applet getApplet(String appletName);
Program
first I am creating the html file named iac.html
<html>
<head>
<title>inter applet communication</title>
</head>
<body>
<applet code="Applet1.class" width="1000" height="500" name="applet1">
</applet>
<hr/>
<applet code="Applet2.class" width="1000" height="500" name="applet2">
</applet>
</body>
</html>