Page 678 - Introduction to Programming with Java: A Problem Solving Approach
P. 678
644 Chapter 16 GUI Programming Basics
16
CHAPTER
GUI Programming Basics
Objectives
• Understand the event-driven programming paradigm. In particular, understand what it means to fire an event, and understand the terms listener and event handler.
• Use the JFrame class to implement window functionality.
• Create and use JLabel, JTextField, and JButton components.
• Implement a listener for the JTextField and JButton components.
• Understand what an interface is and implement the ActionListener interface.
• Understand what an inner class is and implement a listener as an inner class.
• Know the difference between an anonymous inner class and a standard inner class. Apago PDF Enhancer
• Create and use JOptionPane dialog boxes.
• Be able to distinguish between multiple events.
• Describe the primary GUI packages.
• Describe the difference between lightweight and heavyweight components.
Outline
16.1 Introduction
16.2 Event-DrivenProgrammingBasics
16.3 ASimpleWindowProgram
16.4 JFrameClass
16.5 JavaComponents
16.6 JLabelComponent
16.7 JTextFieldComponent
16.8 GreetingProgram
16.9 ComponentListeners
16.10 InnerClasses
16.11 AnonymousInnerClasses
16.12 JButtonComponent
16.13 Dialog Boxes and the JOptionPane Class
644