Java Reference
In-Depth Information
To test the functionality of the window created by the BillPayer class, you
must first compile and then execute the program, as shown in the following steps.
To Test the Functionality of the Window
1. With the Data Disk in drive A, compile the program by clicking Tools on
the menu bar and then clicking Compile Java. If TextPad notifies you of
errors, click BillPayer.java in the Selector window, fix the errors, and then
compile again.
2. When the program compiles with no errors, if necessary, click
BillPayer.java in the Selector window to display the code in the TextPad
window. Click Tools on the menu bar and then click Run Java Application.
The program displays the empty Crandall Power and Light Customer Payments
window (Figure 8-11).
command
prompt
window
application
window
Close
button
Motif
background
FIGURE 8-11
3. To quit the program, click the Close button on the command prompt
window title bar.
OTHER WAYS
1. To compile, press
CTRL + 1
2. To compile at
command prompt,
type javac
BillPayer.java
3. To run, press CTRL + 2 ,
enter data
4. To run at command
prompt, type java
BillPayer and then
enter data
Because line 31 in Figure 8-10 on the previous page overrides the Close
button, you must quit the running program by clicking the Close button in the
command prompt window. Testing your program interface for the ability to dis-
play the basic window is one way to build a program in stages; it allows you to
test individual attributes, such as the location and title of the window, before
entering additional code.
Testing the Interface
When creating a program in stages, test the interface for its ability
to display the basic window before adding components.
Search WWH ::




Custom Search