Java Reference
In-Depth Information
The following steps illustrate how to write code to create a file name, open
the data file, and apply the window listener.
To Open the Data File with a Unique Name
1. Enter the code from Figure 8-19 on page 505.
The TextPad window displays the code to create a file name with the
formatted date appended at the end (Figure 8-22).
code to assign
file name with
formatted date
FIGURE 8-22
2. Enter the code from Figure 8-20 on page 509.
The TextPad window displays the code to open the data file connection
(Figure 8-23).
try block
file constructor
code to display
message box
catch block
code to exit the program
FIGURE 8-23
(continued)
 
Search WWH ::




Custom Search