Java Reference
In-Depth Information
The following steps code the program stub for the Commission applet.
To Code the Applet Stub
1. With the TextPad window displayed, click File on the menu bar and then
click New.
2. With the Data Disk in drive A, click File on the menu bar and then click
Save As on the File menu. When the Save As dialog box is displayed,
type CommissionApplet in the File name text box and then click Java
(*.java) in the Save as type list. Click the Save in box arrow and then
click 3 1 2 Floppy (A:) in the Save in list. Double-click the Chapter04 folder.
Click the Save button.
3. Enter the code as shown in Figure 4-37, using your name and the
current date in the block comment.
TextPad displays the code for the applet stub in the coding window
(Figure 4-38).
applet
code
FIGURE 4-38
You can test the applet stub, even without any commands or data compo-
nents in the applet code. The following steps compile and test the applet stub.
To Compile and Test the Applet Stub
1. With the Data Disk in drive A, compile the program by clicking
Compile Java on the Tools menu. If TextPad notifies you of errors, click
CommissionApplet.java in the Selector window, fix the errors, and then
compile again. When the program compiles with no errors, click Run
Java Applet on the Tools menu.
2. When the Choose File dialog box displays, if necessary, click the box
arrow and then click CommissionApplet.html in the list.
(continued)
Search WWH ::




Custom Search