Java Reference
In-Depth Information
3. Click File on the menu bar and then click Save As on the File menu.
When the Save As dialog box is displayed, type BodyMassApplet in the
File name text box. Do not press the ENTER key. Click the Save as type
box arrow and then click HTML (*.htm*,*.stm*) in the list. If necessary,
click the Save in box arrow, click 3 1 2 Floppy (A:) in the list, and then
double-click the Chapter03 folder in the list.
4. Click the Save button in the Save As dialog box.
TextPad saves the HTML file on the Data Disk in drive A. The file name is
displayed on the title bar of the TextPad window and in the Selector
window.
code for HTML
host document
HTML file
name
FIGURE 3-48
As you learned in Chapter 2, the <APPLET> tag nested within the <HTML>
beginning and ending tags specifies three pieces of information that the Web
page needs to access the Java applet: the name of the Java bytecode file, the
width of the window, and the height of the window in which to run the applet
(Figure 3-48).
Running and Testing an Interactive Applet
You now are ready to run the applet by using TextPad's Run Java Applet
command. The Run Java Applet command automatically executes Java's
appletviewer.exe command to display the Applet Viewer window.
When testing the applet version of the same program, you again should use
the same sample data for testing each version. That way you can compare output
results to ensure that they are consistent for all versions of the program.
To Run and Test an Interactive Applet
1. Click Tools on the menu bar and then click Run Java Applet on the Tools
menu.
2. If necessary, when the Choose File dialog box is displayed, click the box
arrow and choose BodyMassApplet.html in the list. Click the Yes button.
 
Search WWH ::




Custom Search