Java Reference
In-Depth Information
The prototype for the Classics on DVD program has been fully tested. It now
is ready to send to the Internet-based collectors club.
Chapter Summary
In this chapter, you learned to use Swing components. You began with a top-level
container, named JFrame, and used a content pane to place the Swing
components in the interface. You learned how methods associated with JPanels,
JLabels, JTextPanes, JScrollPanes, and JComboBoxes are used to create a drop-
down list as well as formatted, scrollable text components in the content pane.
To assist the user, this program created a JMenu system, complete with sub-
menus and shortcut keys. It used the keyword, super, to place a title in the title
bar of the GUI interface.
You learned how Java supports its Java Foundation Classes (JFC) with look
and feel functionality, as well as how to use window decorations and Swing
methods to give a modern feel to your interface. You learned about tabs, styles,
and the Document class for formatting a JTextPane.
To assist the user of the Classics on DVD program, you added searching and
sorting capabilities. You discovered when a linear search is required and learned
about the different sorting algorithms.
Finally, this chapter showed how to test the JComboBox and each menu item
by running the program and inserting a new movie. The program implemented
and enlarged the three parallel arrays that you created, searched, and sorted
based on given fields and array index numbers.
What You Should Know
Having completed this chapter, you should now be able to perform the tasks
shown in Table 7-11.
Table 7-11
What You Should Know
TASK NUMBER
TASK
PAGE
1
Start TextPad and Save a TextPad Document
438
2
Extend JFrame in the Class Header
442
3
Construct the Swing Components
442
4
Declare and Assign Arrays
446
5
Code the DVD() Constructor Method
447
6
Code the createMenuBar() Method
452
7
Code the createContentPane() Method
455
8
Code the setTabsAndStyles() Method
458
9
Code the addTextToTextPane() Method
460
10
Code the actionPerformed() Method
463
11
Code the enlargeArray() Method
464
 
Search WWH ::




Custom Search