home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 133 / dpcs0399.iso / INTERNET / COFFEE / HTMLED55 / SETUP.EXE / file0178.bin < prev    next >
Encoding:
Text File  |  1998-11-04  |  10.5 KB  |  89 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
  2.    "http://www.w3.org/TR/REC-html40/strict.dtd">
  3. <html lang=en-us>
  4. <head>
  5. <title>APPLET - Java Applet</title>
  6. <link rev=Made href="mailto:liam@htmlhelp.com">
  7. <link rel=Start href="../index.html">
  8. <link rel=Glossary href="http://www.htmlhelp.com/glossary/glossary.html">
  9. <link rel=Copyright href="http://www.htmlhelp.com/copyright.html">
  10. <link rel=StyleSheet href="../style.css" type="text/css">
  11. <link rel=StyleSheet href="../aural.css" type="text/css" media=aural>
  12. <meta name="author" content="Liam Quinn">
  13. <meta name="description" content="A description of HTML 4.0's APPLET element for Java applets.">
  14. <meta name="keywords" content="applet element, java applets, Java, HyperText Markup Language, HTML, HTML4, HTML 4.0, Web Design Group, WDG, <applet> tag">
  15. </head>
  16. <body>
  17. <h2><img src="../wdglogo1.gif" width=250 height=83 alt="The Web Design Group"></h2>
  18. <h1>APPLET - Java Applet</h1>
  19. <table>
  20.   <tr valign=top>
  21.     <th>Syntax</th>
  22.     <td><strong class=required><APPLET></strong>...<strong class=required></APPLET></strong></td>
  23.   </tr>
  24.   <tr valign=top>
  25.     <th>Attribute Specifications</th>
  26.     <td>
  27.       <ul>
  28.         <li>CODE=<var><a href="../values.html#cdata">CDATA</a></var> (class file)</li>
  29.         <li>CODEBASE=<var><a href="../values.html#uri">URI</a></var> (base <abbr class=initialism title="Uniform Resource Indicator">URI</abbr> for class files)</li>
  30.         <li><strong class=required>WIDTH=<var><a href="../values.html#length">Length</a></var> (applet width)</strong></li>
  31.         <li><strong class=required>HEIGHT=<var><a href="../values.html#length">Length</a></var> (applet height)</strong></li>
  32.         <li>ARCHIVE=<var><a href="../values.html#cdata">CDATA</a></var> (archive files)</li>
  33.         <li>OBJECT=<var><a href="../values.html#cdata">CDATA</a></var> (serialized applet)</li>
  34.         <li>NAME=<var><a href="../values.html#cdata">CDATA</a></var> (name for inter-applet communication)</li>
  35.         <li>ALT=<var><a href="../values.html#text">Text</a></var> (alternate text)</li>
  36.         <li>ALIGN=[ top | middle | bottom | left | rightá] (applet alignment)</li>
  37.         <li>HSPACE=<var><a href="../values.html#pixels">Pixels</a></var> (horizontal gutter)</li>
  38.         <li>VSPACE=<var><a href="../values.html#pixels">Pixels</a></var> (vertical gutter)</li>
  39.         <li><a href="../attrs.html">common attributes</a></li>
  40.       </ul>
  41.     </td>
  42.   </tr>
  43.   <tr valign=top>
  44.     <th>Contents</th>
  45.     <td><a href="param.html">PARAM</a> elements followed by <a href="../block.html">block-level elements</a> and/or <a href="../inline.html">inline elements</a></td>
  46.   </tr>
  47.   <tr valign=top>
  48.     <th>Contained in</th>
  49.     <td><a href="../inline.html">Inline elements</a>, <a href="../block.html">block-level elements</a> except <a href="../block/pre.html">PRE</a></td>
  50.   </tr>
  51. </table>
  52. <p>The <strong class=html>APPLET</strong> element is used to embed <em>Java applets</em>. It has been <a href="../deprecated.html">deprecated</a> in HTMLá4.0 in favor of the more generalized <strong class=html><a href="object.html">OBJECT</a></strong> element. However, since the few browsers that support <strong class=html>OBJECT</strong> do so with significant bugs, <strong class=html>APPLET</strong> is currently a more reliable method of embedding Java applets.</p>
  53. <p><strong class=html>APPLET</strong>'s <strong class=html>CODE</strong> attribute specifies the name of the class file that contains the compiled Applet subclass. The value is relative to the <abbr class=initialism title="Uniform Resource Identifier">URI</abbr> specified in the <strong class=html>CODEBASE</strong> attribute, or to the <abbr class=initialism title="HyperText Markup Language">HTML</abbr> document's base <abbr class=initialism title="Uniform Resource Identifier">URI</abbr> if the <strong class=html>CODEBASE</strong> attribute is not given.</p>
  54. <p>The required <strong class=html>WIDTH</strong> and <strong class=html>HEIGHT</strong> attributes define the dimensions of the applet. The value may be given in pixels or as a percentage of the parent element's width or height.</p>
  55. <p>The <strong class=html>ALT</strong> attribute can be used to give alternate text for browsers that recognize the <strong class=html>APPLET</strong> element but do not support Java or do not have Java enabled. Authors can also give alternate content between the start and end tags of the <strong class=html>APPLET</strong> element--a better method than using the <strong class=html>ALT</strong> attribute since it allows authors to include <abbr class=initialism title="HyperText Markup Language">HTML</abbr> markup in the alternate content and also works with pre-<a href="http://www.htmlhelp.com/reference/wilbur/">HTMLá3.2</a> browsers that do not support <strong class=html>APPLET</strong>.</p>
  56. <p>An <strong class=html>APPLET</strong> may contain <strong class=html><a href="param.html">PARAM</a></strong> elements to define applet-specific parameters. <strong class=html>PARAM</strong> elements should be specified before any other content of the <strong class=html>APPLET</strong> element. In the following example, a decorative Java applet takes two parameters. The <strong class=html>APPLET</strong> contains an animated GIF as an alternative for non-Java browsers.</p>
  57. <p class=example><code class=html><APPLET CODE="Animate.class" WIDTH=100 HEIGHT=100><br><PARAM NAME=img1 VALUE="/images/1.jpg"><br><PARAM NAME=img2 VALUE="/images/2.jpg"><br><IMG SRC="animation.gif" ALT="" WIDTH=100 HEIGHT=100><br></APPLET></code></p>
  58. <p>The <strong class=html>ARCHIVE</strong> attribute can specify a comma-separated list of archived files (either absolute <abbr class=initialism title="Uniform Resource Identifier">URI</abbr>s or <abbr class=initialism title="Uniform Resource Identifier">URI</abbr>s relative to the <strong class=html>CODEBASE</strong>), allowing the browser to download many files with a single connection and hence decreasing the total download time. The standard archive format for Java files is <a href="http://java.sun.com/products/jdk/1.1/docs/guide/jar/index.html">JAR</a>. JAR files can be created with the <strong>jar</strong> tool included with the <a href="http://java.sun.com/products/jdk/">Java Development Kit</a> 1.1 and up.</p>
  59. <p class=note>Note that some browsers do not support the <strong class=html>ARCHIVE</strong> attribute, so all necessary files should be available unarchived as well. Other browsers only support a single <abbr class=initialism title="Uniform Resource Identifier">URI</abbr> as the <strong class=html>ARCHIVE</strong> value.</p>
  60. <p>The <strong class=html>OBJECT</strong> attribute specifies a serialized (saved) representation of an applet. The <strong class=html>CODE</strong> attribute should not be used if and only if the <strong class=html>OBJECT</strong> attribute is specified. When the applet is deserialized, its <strong class=java>init()</strong> method is not invoked, but its <strong class=java>start()</strong> method is. Sun recommends restraint in using this poorly supported feature.</p>
  61. <p>The <strong class=html>ALIGN</strong> attribute specifies the alignment of the applet. The values <strong class=html>top</strong>, <strong class=html>middle</strong>, and <strong class=html>bottom</strong> specify the applet's position with respect to surrounding content on its left and right.</p>
  62. <div class=note>
  63. <p><strong class=html>ALIGN=middle</strong> aligns the center of the applet with the current baseline. To center the applet horizontally on the page, place the applet in a centered block, <i lang=la>e.g.</i>,</p>
  64. <p class=example><code class=html><P ALIGN=center><APPLET CODE="Game.class" WIDTH=300 HEIGHT=100></APPLET></P></code></p>
  65. </div>
  66. <p>The other <strong class=html>ALIGN</strong> values, <strong class=html>left</strong> and <strong class=html>right</strong>, specify a <em>floating</em> applet; the applet is placed at the left or right margin and content flows around it. To place content below the applet, use <strong class=html><BR CLEAR=left|right|all></strong> as appropriate.</p>
  67. <p class=note>The <strong class=css><a href="http://www.htmlhelp.com/reference/css/text/vertical-align.html">vertical-align</a></strong> and <strong class=css><a href="http://www.htmlhelp.com/reference/css/box/float.html">float</a></strong> properties of <a href="http://www.htmlhelp.com/reference/css/">Cascading Style Sheets</a> provide more flexible methods of aligning applets.</p>
  68. <p>The <strong class=html>HSPACE</strong> and <strong class=html>VSPACE</strong> attributes allow an author to suggest horizontal gutters and vertical gutters, respectively, around the applet. The value must be in pixels and applies to both sides of the applet. <a href="http://www.htmlhelp.com/reference/css/">Style sheets</a> provide more flexibility in specifying the space around applets.</p>
  69. <h2>More Information</h2>
  70. <ul>
  71.   <li><a href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-APPLET">APPLET in <abbr class=initialism title="World Wide Web Consortium">W3C</abbr> HTMLá4.0 Recommendation</a></li>
  72.   <li><a href="http://www.w3.org/TR/REC-html32#applet">APPLET in <abbr class=initialism title="World Wide Web Consortium">W3C</abbr> HTMLá3.2 Recommendation</a></li>
  73.   <li><a href="http://www.htmlhelp.com/reference/wilbur/special/applet.html">APPLET in <abbr class=initialism title="Web Design Group">WDG</abbr> HTMLá3.2 Reference</a></li>
  74.   <li><a href="http://www.hut.fi/u/jkorpela/HTML3.2/5.4.html">APPLET in <cite>Learning HTMLá3.2 by Examples</cite></a></li>
  75.   <li><a href="http://java.sun.com/products/jdk/1.1/docs/guide/misc/applet.html">The APPLET Tag (<abbr class=initialism title="Java Development Kit">JDK</abbr> 1.1 Documentation)</a>
  76.   <li><a href="http://java.sun.com/docs/books/tutorial/index.html">The Java Tutorial</a>
  77.     <ul>
  78.       <li><a href="http://java.sun.com/docs/books/tutorial/applet/appletsonly/html.html">Using the <APPLET> Tag</a></li>
  79.     </ul>
  80.   </li>
  81. </ul>
  82. <div class=footer>
  83. <address>Maintained by <a href="http://www.htmlhelp.com/%7Eliam/">Liam Quinn</a> <<a href="mailto:liam@htmlhelp.com">liam@htmlhelp.com</a>></address>
  84. <p class=toolbar><a href="http://www.htmlhelp.com/"><img src="../wdglogo-small.gif" width=105 height=40 alt="Web Design Group ~"></a> <a href="../index.html" rel=Start>HTMLá4.0áReference</a>á~ <a href="../olist.html">ElementsábyáFunction</a>á~ <a href="../alist.html">ElementsáAlphabetically</a></p>
  85. <p class=copyright><a href="http://www.htmlhelp.com/copyright.html">Copyright ⌐</a> 1998 Liam Quinn. All rights reserved.</p>
  86. </div>
  87. </body>
  88. </html>
  89.