Page 9 - Introduction to Programming with Java: A Problem Solving Approach
P. 9
viii Contents
14.3. Using try and catch Blocks to Handle
“Dangerous” Method Calls
14.4. Line Plot Example 559
14.5. try Block Details 563
14.6. Two Categories of Exceptions—Checked and
Unchecked 564
14.7. Unchecked Exceptions 566
14.8. Checked Exceptions 569
14.9. The Exception Class and Its getMessage
Method 572
14.10. Multiple catch Blocks 573
14.11. Understanding Exception Messages 576
14.12. Usingthrows <exception-type>toPostpone
the catch 580
14.13. GUI Track and Problem Solving: Line Plot
16.12. JButton Component 662
16.13. Dialog Boxes and the JOptionPane
Class 667
16.14. Distinguishing Between Multiple Events 671 16.15. Using getActionCommand to Distinguish
Between Multiple Events 673 16.16. Color 674
16.17. How GUI Classes Are Grouped Together 679 16.18. Mouse Listeners and Images (Optional) 680
CHAPTER 17
GUIProgramming—ComponentLayout, Additional GUI Components 693
Example Revisited (Optional) 584
CHAPTER 15 Files 601
15.1. Introduction 601
15.2. Java API Classes You Need to Import
602
17.1. 17.2. 17.3. 17.4. 17.5. 17.6. 17.7.
Introduction 694
GUI Design and Layout Managers 694 FlowLayout Manager 696 BorderLayout Manager 698 GridLayout Manager 704 Tic-Tac-Toe Example 707
Problem Solving: Winning at Tic-Tac-Toe (Optional) 710
15.7. Binary File I/O
15.8. Object File I/O 622
15.9. The File Class 626
15.10. GUI Track: The JFileChooser Class (Optional) 629
CHAPTER 16
GUI Programming Basics 644
16.1. Introduction 645
16.2. Event-Driven Programming Basics
17.9. JPanel class 714
17.10. MathCalculator Program 715
17.11. JtextArea Component 719
17.12. JcheckBox Component 721
17.13. JradioButton Component 724
17.14. JcomboBox Component 726
17.15. Job Application Example 729
17.16. More Swing Components 734
618
557
15.3. Text-File Output 604
15.4. Text-File Input 608
15.5. HTML File Generator 612
15.6. Text File Data Format Versus Binary
File Data Format 615
Apago PDF Enhancer
17.8. Embedded Layout Managers 712
16.3. A Simple Window Program
16.4. JFrame Class 649
16.5. Java Components 651
16.6. JLabel Component 652
16.7. JTextField Component
16.8. Greeting Program 654
16.9. Component Listeners 657
647
653
16.10. Inner Classes 658
16.11. Anonymous Inner Classes 659
646
Appendices
Appendix 1
Appendix 2 Appendix 3 Appendix 4 Appendix 5 Appendix 6 Appendix 7 Appendix 8 Appendix 9
Unicode/ASCII Character Set with Hexadecimal Codes 745 Operator Precedence 749
Java Reserved Words 751 Packages 755
Java Coding-Style Conventions 759 Javadoc 771
UML Diagrams 778
Recursion 784
Multithreading 794