SWING
Revision: TE2407_20071126
(7.79 KB) View, Download, or Print Catalog as a PDF.
Course Length:
5 Days
Course Description:
This 5-day course will introduce Java programmers to the Swing package. The Swing package, extending the AWT, provides efficient and easy-to-use tools for manipulating graphics. Students completing this course will have the ability to create fully-functional, customizable, graphical user interfaces.
Who Should Attend:
This course is designed for Java programmers of any level.
Benefits of Attendance:
Upon completion of this course, students will be able to:
- Describe the key features of Swing
- Contrast the use of Swing and the AWT
- Add components to a JFrame using the ContentPane
- Write Swing Applications using Swing components such as JLabel, JButton, JTextField, JTree, etc.
- Implement keystroke handling in response to keyboard events from a user
- Understand InputMap and ActionMap
- Use the printing capability to print GUIs
- Describe the Model View Controller Architecture
- Encode Model View Architecture components
- Write code that uses Border objects to alter the appearance of components
- Create programs using various Pane components such as JTabbedPane, JSplitPane, JScrollPane, and JOptionPane
- Write programs that support cut/paste and drag/drop
Prerequisites:
Java programming experience is required. Experience with the AWT is helpful, but not required.
Course Outline:
- Chapter 1: An Introduction to Swing
- Rational for the Swing Components
- Java Foundation Classes
- Lightweight Components
- Features of the Swing Components
- The AWT Components
- An Example Using the AWT Components
- Building a Minimum Swing Application
- Chapter 2: Window Events
- Introduction
- Window Positioning
- Handling Window Events
- Window Closing Styles
- Inner Classes
- Anonymous Inner Classes
- Chapter 3: Simple Swing Components
- Introduction
- JButton with Selected Fonts
- JButton with an Icon
- The Icon Interface
- JButton with a Mnemonic
- Labels
- Chapter 4: Keystrokes
- The Focus
- Focus Traversal
- Keyboard Input
- Keyboard Shortcuts
- Keystrokes and Actions
- Chapter 5: Dialogs
- What is a Dialog?
- A Simple Dialog
- Adding Components to a Dialog
- Chapter 6: Menus and Toolbars
- AWT vs. Swing Menus
- Adding Mnemonics
- Adding Accelerators
- Adding Colors Fonts, and Icons
- Toolbars
- Chapter 7: Painting and Graphics
- Painting Basics
- The paintComponent Method
- Some Methods of the Graphics Class
- Creating a Drawing Area
- Drawing Area Source Code
- Chapter 8: Printing
- Printing Basics
- A Printing Example
- Using the Book Class
- Chapter 9: Layout Managers
- Introduction
- FlowLayout
- GridLayout
- BorderLayout
- CardLayout
- GridBagLayout
- GridBagConstraints
- BoxLayout
- OverlayLayout
- Chapter 10: Models, Views, and Controllers
- Introduction
- The MVC Process of JButton
- Advantages to using the MVC Architecture
- Pluggable Look and Feel
- An MVC Example
- Linking the Components
- MVC Diagram
- ListModel
- AbstractListModel
- JTable
- TableModel
- MVCList Source Code
- Chapter 11: Using the JTree
- Tree Basics
- The DefaultMutableTreeNode
- DefaultTreeModel
- Constructing a JTree
- Customizing the JTree
- Tree Listeners
- Chapter 12: Text Components
- Various Text Components of Swing
- JTextField
- JPasswordField
- JTextArea
- Using a JScrollPane
- JTextPane
- StyleConstants
- StyleTest Source Code
- Chapter 13: Utility Panes, Borders, and Focus
- Various Utility Panes
- JTabbedPane
- JSplitPane
- JFileChooser
- JOptionPane
- Using Borders
- Chapter 14: Creating Custom Components
- Extending JComponent
- Creating RButton
- RButton's Model to View
- The Constructor
- More with Listeners
- RButton Source Code
- Chapter 15: Clipboard and Drag & Drop
- Clipboard
- DataFlavors
- System Clipboard vs. Custom Clipboard
- More with DataFlavors
- Drag & Drop
- Appendix A: Events and Their Listeners
- AWT Events
- Swing Events
- Appendix B: Accessibility
- Accessible Applications
- The ADA and Section 508 Regulations
- Accessibility Needs
- Java Support for Accessibility
- The Java Accessibility API
- AccessibleContext
- Section 508 Accessibility Standards
- Section 1194.21 (a) - Keyboard Access
- Section 1194.21 (b) - Accessibility Features
- Section 1194.21 (c) - Input Focus
- Section 1194.21 (d) - Object Information
- Section 1194.21 (e) – Bitmap Images
- Section 1194.21 (f) – Textual Information
- Section 1194.21 (g) – User Selected Attributes
- Section 1194.21 (h) – Animation
- Section 1194.21 (i) – Color Coding
- Section 1194.21 (j) – Color and Contrast
- Section 1194.21 (k) – Flicker Rate
- Section 1194.21 (l) – Electronic Forms
- The Java Accessibility Bridge
- Resources



