Java Reference
In-Depth Information
1. ___________________________________________________________________
2. ___________________________________________________________________
3. ___________________________________________________________________
4. ___________________________________________________________________
5. ___________________________________________________________________
6. ___________________________________________________________________
7. ___________________________________________________________________
8. ___________________________________________________________________
Creating a Menu System
Figure 6-49 displays a sketch of a menu system. On paper, write the lines of code
necessary to create the menu system using MenuBar, Menu, and MenuItem
components. Use appropriate, user-friendly variable names.
FIGURE 6-49
Using the Java API
The Java API is a good tool to look up information about a class with which you
may be unfamiliar or to check the syntax of commands and methods you wish
to use in your programs. While connected to the Internet, start a browser and
then enter http://java.sun.com in the Address text box. When the home page
displays, enter the phrase "Windows Desktop Property Support" in the
Search text box and then click the Search button (be sure to include the quota-
tion marks). When the Results page displays, click the page labeled Windows
Desktop Property Support in the results list. When the Windows Desktop
Property Support page displays, read the information.
Create a short application named Properties that executes the first set of
code statements listed on the page. Hint: You must import the classes from the
java.awt package. Compile and run the program. View the results.
Then, using the Geometry Properties table along with what you learned in
this chapter about the getDefaultToolkit() method, write a statement to retrieve
the operating system Menu font. Assign it to an object variable. Then use the
System.out.println() method to print the value.
 
Search WWH ::




Custom Search