< Zurück | Inhalt | Weiter >

17.2 Adding support for running as an applet

If you are running a flavor of Windows and you navigate to a web page that contains a Java applet (e.g., figure 17.2), the Java applet will be launched using the web browser’s JVM. On a Windows machine, this will be the Microsoft VM, which does not implement the Java 2 (SDK 1.2) release of the J2SE platform. Your applets based on Java 2 will therefore not be started by the Microsoft VM.

As the relationship between Sun and Microsoft has been a little frosty of late, it is unlikely that Sun can negotiate with Microsoft to get its JVM shipped with new installations of Windows. This has forced Sun to develop the Java plug−in product. The Java plug−in is a web−browser plug−in that installs on a Windows machine and can download the Java 2 JRE and launch a Java 2 JVM capable of running Java 2 applications.

Because web−browser plug−ins can be installed with little user intervention by the web browser, the idea is that the installation and launch of the plug−in should be made as simple as possible.


Figure 17.2 The SwingTest example running as an applet inside Internet Explorer. Note Java 2 plug−in Swing console and the Duke icon in the system tray


17.2.1 Original HTML applet code
17.2.2 Using the Java 2 plug−in HTMLConverter
17.2.3 The end−user experience
17.2.4 Automatic Java 3D installation
17.2.5 Applets and security