Java Reference
In-Depth Information
8 Entering Course Substitutions (continued)
Table 8-14
CODE
else //code to execute if the user clicks Exit
{
try
{
output.close();
}
catch(IOException c)
{
System.exit(1);
}
System.exit(0);
}
18. Close the actionPerformed() method. Define the clearFields() method that is
called in Step 16 on the previous page.
19. Compile the program. If errors occur, fix them in the TextPad source code
window and then compile the program again.
20. Run the program and enter sample data for five students with fictitious ID
numbers and transfer courses.
21. Print the source code for your instructor.
9 Displaying Stock Information
Open the file hotStocks.java from the Data Disk (see the inside back cover of this
book for instructions on how to obtain a copy of the Data Disk).
You have accepted a job as an intern at a stock brokerage firm. Your first task
is to create an interface to read in the previous day's “hottest” stocks, which are
stored sequentially in a binary file named hotStocks.dat (also on the Data Disk).
Create a storyboard similar to the program interface displayed in Figure 8-39.
Decide on your colors, your layout manager(s), and the names of your
components.
FIGURE 8-39
Search WWH ::




Custom Search