Java Reference
In-Depth Information
8. Create the following instance methods: getFirstName(), getLastName(),
getPosition(), getRate(), and getHours(). The methods need only to return
the corresponding class variable.
9. Compile the program. If you have errors, fix them in the TextPad window,
save, and then recompile.
10. Print a copy of the source code for your instructor.
6 Creating an Applet with Drop-Down Lists
David Leeson, owner of David's Campground, would like an applet to help his
customers reserve camping sites on the Web. His paper reservation system includes
fields for the customers' personal information, the date they plan to arrive, and the
number of nights they will stay. His paper reservation form also lists the type of
hookups, such as water only or water and electricity, the customer wants. David
writes down the type of camping vehicles, such as pop-up, travel trailer, and tent.
David would like these fields and lists easily available in the applet window.
Additionally, he would like a Submit button and a Clear button, as shown in
Figure 5-52.
FIGURE 5-52
Part A: Creating the Host Document
1. Start TextPad. When the coding window opens, type the HTML tag and
then, on the next line, begin the APPLET tag.
2. Use a CODE statement to access the DavidApplet.class. Use a WIDTH
statement of 550 and a HEIGHT statement of 400.
3. Close the APPLET and HTML tags.
4. Save the code as an HTML file on your Data Disk using the file name
DavidApplet.html.
Search WWH ::




Custom Search