Inter Applet Communication On Different Pages

java packages » java.applet
Java Example Program / Sample Source Code
import java.applet.Applet;
import java.awt.*;

public class InterAppletCommunication2 extends Applet {
public void init() {
Label label = new Label("Message from 1st Applet");
add
(label);
TextField textfield =
new TextField(50);
add
(textfield);
String s = getDocumentBase
().toString();
String s1 = s.substring
(s.indexOf('?') + 1);
s1 = s1.substring
("message=".length());
s1 = s1.replace
('+', ' ');
textfield.setText
(s1);
}
}
Html Code
<html>
    <body>
        <applet code="InterAppletCommunication1" name="InterAppletCommunication1" height="300" width="350"></applet>
    </body>
</html>
<html>
    <body>
        <applet code="InterAppletCommunication2" name="InterAppletCommunication2" height="300" width="350"></applet>
    </body>
</html>

Applet


AppletContext

2011-2021 JavaExamples.org Privacy Policy Powered by Google App Engine