Send A Message From An Applet To Another Applet On A Different Page

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

public class InterApplet2 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="InterApplet1" name="InterApplet1" height="300" width="350"></applet>
    </body>
</html>
<html>
    <body>
        <applet code="InterApplet2" name="InterApplet2" height="300" width="350"></applet>
    </body>
</html>

Applet


AppletContext

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