blob: ff46eddc202f5aa49ea21954b2cac316cab290e4 [file] [log] [blame]
<html>
<HEAD>
<TITLE>AppletViewer Tags</TITLE>
</HEAD>
<BODY bgcolor="white">
<TABLE BORDER="0" WIDTH="100%" summary="layout">
<TR>
<TD>
<IMG SRC="../images/javalogo52x88.gif" ALT="Java" BORDER=0 WIDTH=52 HEIGHT=88>
</TD>
<TD>
<center>
<h1>AppletViewer Tags</h1>
</center>
</TD>
<TD ALIGN=RIGHT VALIGN=TOP>
<font size="-1"><a href="../index.html">Documentation Contents</a></font>
</TD>
</TR>
</TABLE>
<!-- ======================== Body text begins here ===================== -->
The applet viewer makes it possible to run a Java applet without using
a browser. AppletViewer ignores any HTML that is not immediately relevant
to launching an applet. However, it recognizes a wide variety of applet-
launching syntax. The HTML code that AppletViewer recognizes is shown
below. All other HTML code is ignored.
<p>
<b>object</b><br>
<blockquote>
The <code>object</code> tag is the HTML 4.0 tag for embedding applets
and mult-media objects into an HTML page. It is also an Internet Explorer
4.x extension to HTML 3.2 which allows IE to run a Java applet using the
latest Java plugin from Sun.
<pre>
&lt;object
width="<i>pixelWidth</i>"
height="<i>pixelHeight</i>"
&gt;
&lt;param name="code" value="<i>yourClass.class</i>"&gt;
&lt;param name="object" value="<i>serializedObjectOrJavaBean</i>"&gt;
&lt;param name="codebase" value="<i>classFileDirectory</i>"&gt;
...
<i>alternate-text</i>
&lt;/object&gt;
</pre>
<b>Notes:</b><br><ul>
<li>AppletViewer ignores the "classID" attribute, on the assumption
that it is pointing to the Java plugin, with the value:<br>
&nbsp;&nbsp;<code>
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
</code>
<p>
<li>AppletViewer also ignores the "codebase" attribute that is usually included
as part of the object tag, assuming that it points to a Java plugin
in a network <b>cab</b> file with a value like:<br>
<code>&nbsp;&nbsp;
codebase="http://java.sun.com/products/plugin/1.1/jinstall-11-win32.cab#Version=1,1,0,0"
</code>
<p>
<li>The optional <code>codebase</code> param tag supplies a relative URL that
specifies the location of the applet class.
<p>
<li>Either <code>code</code> or <code>object</code> is specified, not both.
<p>
<li>The <code>type</code> param tag is not used by AppletViewer, but should be
present so that browsers load the plugin properly.<br>
For an applet, the value should be something like:<br>
<code>&nbsp;&nbsp;
&lt;param name="type" value="application/x-java-applet;version=1.1"&gt;
</code><br>
or<br>
<code>&nbsp;&nbsp;
&lt;param name="type" value="application/x-java-applet"&gt;
</code><br><br>
For a serialized object or JavaBean, the <code>type</code> param
value should be something like:<br>
<code>&nbsp;&nbsp;
&lt;param name="type" value="application/x-java-bean;version=1.1"&gt;
</code><br>
or<br>
<code>&nbsp;&nbsp;
&lt;param name="type" value="application/x-java-bean"&gt;
</code>
<p>
<li>Other param tags are argument values supplied to the applet.
<p>
<li>The <code>object</code> tag recognized by IE4.x and the <code>embed</code> tag
recognized by Netscape 4.x can be combined so that an applet can
use the latest Java plugin from Sun, regardless of the browser that
downloads the applet.<br>
For more information, see
<a href="http://java.sun.com/products/plugin/1.3/docs/tags.html">Java
PlugIn HTML Specification</a>
<p>
<li>AppletViewer does not recognize the <code>java_code</code>, <code>java_codebase</code>,
<code>java_object</code>, or <code>java_type</code> param tags. These tags
are only needed when the applet defines parameters with the names
code, codebase, object, or type, respectively. (In that situation, the
plugin recognizes and uses the <code>java_</code> version in preference to the
version that will be used by the applet.) If the applet requires a
parameter with one of these 4 names, it may not run in AppletViewer.
</ul>
</blockquote>
<p>
<b>embed</b><br>
<blockquote>
The <code>embed</code> tag is the Netscape extension to HTML 3.2 that allows
embedding an applet or a multimedia object in an HTML page. It allows a
Netscape 4.x browser (which supports HTML 3.2) to run a Java applet using the
latest Java plugin from Sun.
<pre>
&lt;embed
code="<i>yourClass.class</i>"
object="<i>serializedObjectOrJavaBean</i>"
codebase="<i>classFileDirectory</i>"
width="<i>pixelWidth</i>"
height="<i>pixelHeight</i>"
&gt;
...
&lt;/embed&gt;
</pre>
<b>Notes:</b><br>
<ul>
<li>The <code>object</code> and <code>embed</code> tags can be combined so that
an applet can use the latest Java plugin from Sun, regardless of
the browser that downloads the applet.<br>
For more information, see the
<a href="http://java.sun.com/products/plugin/1.3/docs/tags.html">Java
PlugIn HTML Specification</a>
<p>
<li>Unlike the <code>object</code> tag, all values specified in an <code>embed</code>
tag are attributes (part of the tag) rather than parameters (between the start
tag and end tag, specified with a <code>param</code> tag.
<p>
<li>To supply argument values for applet parameters, you add additional
attributes to the <code>&lt;embed&gt;</code> tag.
<p>
<li>AppletViewer ignores the "src" attribute that is usually part of an
<code>&lt;embed&gt;</code> tag.
<p>
<li>Either <code>code</code> or <code>object</code> is specified, not both.
<p>
<li>The optional <code>codebase</code> attribute supplies a relative URL that
specifies the location of the applet class.
<p>
<li>The <code>type</code> attribute is not used by AppletViewer, but should be
present so that browsers load the plugin properly.<br>
For an applet, the value should be something like:<br>
<code>&nbsp;&nbsp;
&lt;type="application/x-java-applet;version=1.1"&gt;...
</code><br>
or<br>
<code>&nbsp;&nbsp;
&lt;type="application/x-java-applet"&gt;...
</code><br><br>
For a serialized object or JavaBean, the <code>type</code> param
value should be something like:<br>
<code>&nbsp;&nbsp;
&lt;type="application/x-java-bean;version=1.1"&gt;...
</code><br>
or<br>
<code>&nbsp;&nbsp;
&lt;type="application/x-java-bean"&gt;...
</code>
<p>
<li>The "pluginspage" attribute is not used by AppletViewer, but should be
present so that browsers load the plugin properly. It should point to a Java plugin
in a network <b>cab</b> file with a value like:<br>
<code>&nbsp;&nbsp;
pluginspage="http://java.sun.com/products/plugin/1.1/jinstall-11-win32.cab#Version=1,1,0,0"
</code>
</ul>
</blockquote>
<p>
<b>applet</b><br>
<blockquote>
The <code>applet</code> tag is the original HTML 3.2 tag for
embedding an applet in an HTML page. Applets loaded using the
<code>applet</code> tag are run by the browser, which may not
be using the latest version of the Java platform. To ensure that
the applet runs with the latest version, use the <code>object</code>
tag to load the Java plugin into the browser. The plugin will then
run the applet.
<pre>
&lt;applet
code="<i>yourClass.class</i>"
object="<i>serializedObjectOrJavaBean</i>"
codebase="<i>classFileDirectory</i>"
width="<i>pixelWidth</i>"
height="<i>pixelHeight</i>"
&gt;
&lt;param name="<i>...</i>" value="<i>...</i>"&gt;
...
<i>alternate-text</i>
&lt;/applet&gt;
</pre>
<b>Notes:</b><br>
<ul>
<li>Either <code>code</code> or <code>object</code> is specified, not both.
<p>
<li>The optional <code>codebase</code> attribute supplies a relative URL that
specifies the location of the applet class.
<p>
<li>Param tags supply argument values for applet parameters.
</ul>
</blockquote>
<p>
<b>app</b><br>
<blockquote>
The <code>app</code> tag was a short-lived abbreviation for
<code>applet</code> that is no longer supported. AppletViewer
translates the tag and prints out an equivalent tag that is supported.
<pre>
&lt;app
class="<i>classFileName</i>" (<i>without</i> a .class suffix)
src="<i>classFileDirectory</i>"
width="<i>pixelWidth</i>"
height="<i>pixelHeight</i>"
&gt;
&lt;param name="..." value="..."&gt;
...
&lt;/app&gt;
</pre>
</blockquote>
For more information on the tags that AppletViewer supports and<br>
how to combine them, see the
<a href="http://java.sun.com/products/plugin/1.3/docs/tags.html">Java
PlugIn HTML Specification</a>.
<P>
<HR SIZE=3 NOSHADE>
<TABLE BORDER="0" WIDTH="100%" summary="layout">
<TR VALIGN=TOP>
<TD>
<P><FONT SIZE="-2">
<A HREF="../relnotes/SMICopyright.html">Copyright</A> &#169; 2001
<A HREF="http://www.sun.com">Sun Microsystems, Inc.</A>
All Rights Reserved.</FONT></P>
</TD>
<TD ALIGN=RIGHT>
<IMG SRC="../images/sunlogo64x30.gif" ALT="Sun" BORDER=0 WIDTH=64 HEIGHT=30>
<BR>
<FONT SIZE="+1">
<i>Java Software</i>
</FONT>
</TD>
</TR>
</TABLE>
<BR><BR><BR><BR><BR><BR><BR><BR>
</body>
</html>