ptg7068951
Using the Object Tag 245
Before you can test the WeightScaleapplet, you must create a web page
that contains the applet. Create a new HTMLfile in NetBeans called
WeightScale. Enter Listing 17.4 into the file, and then open the newly cre-
ated web page in a browser—right-click WeightScale.htmlin the Project
pane and choose View.
LISTING 17.4 The Full Text of WeightScale.html
1: <appletcode=”WeightScale.class”codebase=”..\..\build\classes”
2: height=”170”width=”210”>
3: <paramname=”person”value=”Konishiki”>
4: <paramname=”weight”value=”605”>
5:
This demonstration uses Konishiki, an American-born sumo wrestling
champion who weighed 605 pounds when he competed, making him the
largest of the immodest, bikini-wearing behemoths. You can substitute
anyone whose weight is either exemplary or well-known. Figure 17.2
shows an example of output from the applet.
FIGURE 17.2
TheWeightScaleapplet loaded
with Internet Explorer.
To make the applet display a different name along with a different value
for the weightparameter, you have to change the WeightScale.htmlfile.
The applet itself continues to work correctly.
Using the Object Tag
The newest version of HTML, HTML5, has replaced the