Applet Scripting

JavaScript can execute methods in an Applet and also retrieve data from an Applet.

Warning:  MS  JVM (Microsoft's) vs Sun's JVM & applets.  The statements below have been tested with IE v6.0.


Example: JavaScript executes a public Applet method

Applet (Compiled with J2SE 1.2) - Works with MS JVM & Sun's JVM

Sorry, your browser does not support Java Applets.

document.myApplet_orig1.newText( "Hello World" )

Applet (Compiled with J2SE 1.5) - Only works with Sun's JVM.

If you use MS JVM you will get the following :

Sorry, your browser does not support Java Applets.

document.myApplet_orig1.newText( "Hello World" )


Example: JavaScript get data from public Applet method

Testing links:

Send a default text message to all Applets.



Applet #1

Sorry, your browser does not support Java Applets.

Applet #2

Sorry, your browser does not support Java Applets.

Applet #3

Sorry, your browser does not support Java Applets.

Testing URLs:
http://localhost/michael-thomas/tech/java/javaadvanced/appletsjavascript/appletsjavascript.htm
http://www.michael-thomas.com/tech/java/javaadvanced/appletsjavascript/appletsjavascript.htm