aboutsummaryrefslogtreecommitdiffstats
path: root/tests/reproducers/simple/JavascriptURLProtocol/srcs/JavascriptProtocol.java
blob: 073f1666516a1dce812005a4987dbe4c86f5cf41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.applet.Applet;
import java.net.URL;
import netscape.javascript.JSObject;

public class JavascriptProtocol extends Applet {
    public String state = "HasntRun";
    @Override
    public void start() {
        try {
            getAppletContext().showDocument(new URL("javascript:runSomeJS()"));
            System.out.println("State after showDocument was " + state);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("*** APPLET FINISHED ***");
    }
    // Utility for JS side
    public void print(String s) {
        System.out.println(s);
    }
}