Java Reference
In-Depth Information
The following step enters code for the main() method.
To Code the main() Method
1. Enter the code as shown in Figure 7-37 on the previous page.
TextPad displays the code for the main() method (Figure 7-38).
main()
method
FIGURE 7-38
Other constants available with the setDefaultCloseOperation()
method besides EXIT_ON_CLOSE include DO_NOTHING_ON_CLOSE,
DISPOSE_ON_CLOSE, and HIDE_ON_CLOSE. When using multiple windows
in an application, those no longer needed should be disposed of so that they free
system resources without exiting the program. Hidden windows are appropriate
for totals or summaries that display repeatedly, interspersed with other windows.
The DO_NOTHING_ON_CLOSE should be used sparingly and only as a tem-
porary state when the program demands further interaction by the user before
closing the window.
Compiling the Prototype
Compiling the program will test for specific Java errors associated with syntax
and construction. Once the program is error free, it can be tested. Each menu
option and each item in the drop-down list should be tested.
The following step shows how to compile the Classics on DVD prototype.
To Compile the Classics on DVD Prototype
OTHER WAYS
1. Click Tools on the menu bar, and then click Compile Java.
The program compiles.
1. Press CTRL + 1
2. To compile at
command prompt,
type javac DVD.java
Search WWH ::




Custom Search