logo_michael-thomas.jpg (3143 bytes)

Applet Scripting: Applets & Javascript

Examples

bullet

Applets and Javascript - Example of using JavaScript to talk to an Applet (Applet scripting).

bullet

Applet Scripting from a JAR file - Jar (Java Archive)

Applet Scripting Issues

bulletMS  JVM (Microsoft's) vs Sun's JVM & applets.  The statements below have been tested with IE v6.0.
bulletJava Applets compiled with SDK 1.5 will not work with MS JVM.  You will need to use Sun's JVM.  MS JVM can't load the .class file.
bulletMS JVM (Microsoft's Java Virtual Machine) is based on API 1.1.6
bulletJava Applets compiled with JDK 1.2 will work with MS JVM provided that you just use API 1.1 calls.
bullet

IE - Java Console
bullet

MS JVM
bullet

View the Java Console (for Microsoft JVM only).
bullet

Launch IE.

bullet

Click View, Java Console.  (Note: If you don't see the option "Java Console" then you need enable "Java Console".

bullet

To enable "Java Console"
bullet

Launch IE

bullet

Tools, Internet Options, Advanced

bullet

Find the "Microsoft VM" section

bullet

Check - "Java console enabled (requires restart)
Check - "Java logging enabled"

bullet

Now close all of the browser windows (this is a restart).

bullet

Now launch IE and view the Java Console.

bullet

Sun's JVM
bullet

View the Java Console (for Sun's JVM only).
bullet

Launch IE.

bullet

Tools, "Sun Java Console".  (If this option doesn't appear then you need to install Sun's JVM.)

bullet

Enable Sun's JVM
bullet

Launch IE.

bullet

Tools, Internet Options, Advanced

bullet

Find the "Java (Sun)" section.  (If you don't have one then you don't have Sun's JVM installed.)

bullet

Check the "JVM that you want enabled."

bullet

Now close all of the browser windows (this is a restart).

bullet

Now launch IE and view the Java Console.

 

bullet

IE settings - allow Applet Scripting
bullet

Example Error if Applet scripting is not allowed:
A Runtime Error has occurred.
Do you wish to Debug?
Line: <line no. where you access the applet>
Error: Object doesn't support this property or method.

bulletSteps to: Allow Applet Scripting (Javascript can talk to an Applet)
Applet scripting
- allowing Javascript to communicate with an Applet.
bulletSteps using default security levels.
bulletLaunch IE.
bulletTools, Internet Options,
bulletClick on the tab: Security
bulletClick on the "Internet" world icon.  The zone will show "Internet".
bulletClick on "Custom Level".  The "Security Setting" window will open up.
bulletAt the bottom, select "Medium" for the "Reset to:" option.  Click "Reset".
bulletClick "OK".
bulletYou should now be back at the "Internet Options" window.  The security level for this zone should be "Custom".
bulletClick "Default Level" - Note:  This is suppose to set the security to "Medium" (the same steps you just took above).
bulletClick Apply.
bulletYou are finished!
bulletSecurity Properties
bulletFollow the steps above to get to the "Security Setting" window.
bulletLook for the section "Scripting".  Click "Enable" for "Scripting of Java Applets".
bulletSteps to: Display JavaScript Errors
bulletLaunch IE.
bulletTools, Internet Options,
bulletClick on the tab: Advanced
bulletUnder the section "Browsing"
bulletUnCheck - Disable Script Debugging (Internet Explorer)
bulletUnCheck - Disable Script Debugging (Other)
bulletCheck - Display a notification about every script error