Applet To Applet Communication On Different Pages

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

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

Applet


AppletContext

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