Chapter 3: Using Java on Your Pages |
index | previous | next | ||||
|
|||||
|
Passing parameters to an appletIn order to use a canned applet, you need a way to pass parameters from HTML to Java.In other words, someone who knows only HTML should be able to get the applet to display something different by making changes to the page in HTML. This is accomplished by means of the PARAM tag used within the APPLET tag as shown in Listing 3.5. A well-documented applet will include a list of all the possible parameters, showing all the possible values including default values. The documentation for the tinyScroller applet (as downloaded in the previous section) is shown in the sidebar on the next page. If a canned applet doesn't accept parameters you can still use it on your page, but it means that what you're displaying isn't personalized in any way - anyone else with the same applet will have identical results. Here, we pass parameters to the tinyScroller applet to display a unique page. |