Applets
Contents<APPLET ...><APP ...><PARAM ...> |
<APPLET ...> |
If you are familiar with putting pictures in your web page, you will probably find that putting applets in your page is very similar (though not identical). The applet program (called a "class" file) is a separate file from your HTML file. You use the tags
<APPLET ...><PARAM ...><IMG ...>
<APPLET ...><PARAM ...><APPLET ...>
For example, this HTML code calls an applet called "MyApplet", and tells MyApplet to display the words "Hi There":
| this code | produces this |
<APPLET CODE="MyApplet.class" WIDTH=200 HEIGHT=50>
<PARAM NAME=TEXT VALUE="Hi There">
<P>Hi There!<P>
</APPLET>
|
Here's what each piece means:
<APPLET CODE="MyApplet.class" WIDTH=200 HEIGHT=50>- Run the applet "MyApplet.class". The area for the applet should be 200 x 50.
<PARAM NAME=TEXT VALUE="Hi There">- Pass this information to the applet: the text (NAME=TEXT) should be "Hi There"
(VALUE="Hi There")
<P>Hi There<P>- This is what is displayed in browsers that don't understand applets.
</APPLET>- End of the code to run this applet.
The HTML for putting applets into a page is very standardized: you only need to learn a few tags and attributes. However, each applet has its own set of parameters which are used to make it run.
Since every applet is different, you need to know what parameters to use for each applet. For
example, the MyApplet applet requires you to use the TEXT parameter, but that's just
MyApplet; most applets have no such parameter. To learn how to use each applet, consult the
documentation for that applet.
Copyright 1997-2002 Idocs Inc.
