HTML and CSS Reference
126.96.36.199. Writing applets
Creating Java applets is a programming task, not usually a job for the
HTML or XHTML author. For details, we recommend that you consult any
of the many Java programming texts, including those from O'Reilly.
Developed by Sun Microsystems, Inc. of Mountain View, California, Java
supports an object-oriented programming style wherein classes of ap-
plets can be used and reused to build complex applications. One would
think that applets written in the same language should run in any
browser that supports Java. As is so often the case, reality is more com-
plex. Until Netscape 6 and Internet Explorer 6, browsers included their
own Java Virtual Machines (JVMs), and their implementations, especially
Microsoft's, could be quirky. Certain Microsoft implementation decisions
in Internet Explorer 4 and earlier caused some valid Java applets to
fail when running. Microsoft fixed these problems with Internet Explorer
version 5 but, because of its lawsuit with Sun, chose not to include a
JVM in Internet Explorer 6. [*] Although this may sound like bad news for
applets, in fact, Internet Explorer 6 prompts you to download Microsoft's
JVM. Sun's Java Plug-in is free over the Internet. Users of any browser
can install the Java Plug-in to get state-of-the-art Java support.
[*] As we wrote this, even this situation may change, with Microsoft reversing itself and deciding to in-
clude a JVM in a service pack for Windows XP. There is still no sign of default inclusion of a JVM in
Internet Explorer 6 downloads, however.
We should take this opportunity also to mention ActiveX, an alternative
executable content technology originally developed by Microsoft. Act-
iveX itself is proprietary, closely coupled with various versions of Mi-
crosoft Windows, and Microsoft's plug-in works only when used with In-
ternet Explorer, though alternative plug-in implementations now exist
for all the popular browsers.
ActiveX controls (as they are called) run on browser versions targeted to
various versions of Windows, but a single ActiveX control will not run on
these different versions without recompilation. This is in contrast with
Java applets; a single Java applet can be written and compiled once and
immediately run on a broad range of browsers and operating systems.