jsjavacomm example — Hello World!

When this page loads you should see a JavaScript alert message which has been called from a Java applet.

Source code

helloWorld.html

The object element of this page which loads the applet looks like this:

<object id="helloWorldApplet" name="helloWorldApplet" type="application/x-java-applet"
	archive="jsjavacomm-0.1-SNAPSHOT-tests.jar,jsjavacomm-0.1-SNAPSHOT.jar"
	code="net.sourceforge.jsjavacomm.examples.HelloWorld"
	width="0" height="0">
	<param name="mayscript" value="true" />
</object>

HelloWorld.java

Here's the essentials of what the java applet code looks like:

public class HelloWorld extends JSApplet {

	public void start() {
		JSDOMImplementation domImpl = new JSDOMImplementationImpl();
		JSWindow window = domImpl.getWindow(this);
		window.alert("Hello world!");
	}
}