Skip Navigation Links

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
    1. Rational for the Swing Components
    2. Java Foundation Classes
    3. Lightweight Components
    4. Features of the Swing Components
    5. The AWT Components
    6. An Example Using the AWT Components
    7. Building a Minimum Swing Application
  • Chapter 2: Window Events
    1. Introduction
    2. Window Positioning
    3. Handling Window Events
    4. Window Closing Styles
    5. Inner Classes
    6. Anonymous Inner Classes
  • Chapter 3: Simple Swing Components
    1. Introduction
    2. JButton with Selected Fonts
    3. JButton with an Icon
    4. The Icon Interface
    5. JButton with a Mnemonic
    6. Labels
  • Chapter 4: Keystrokes
    1. The Focus
    2. Focus Traversal
    3. Keyboard Input
    4. Keyboard Shortcuts
    5. Keystrokes and Actions
  • Chapter 5: Dialogs
    1. What is a Dialog?
    2. A Simple Dialog
    3. Adding Components to a Dialog
  • Chapter 6: Menus and Toolbars
    1. AWT vs. Swing Menus
    2. Adding Mnemonics
    3. Adding Accelerators
    4. Adding Colors Fonts, and Icons
    5. Toolbars
  • Chapter 7: Painting and Graphics
    1. Painting Basics
    2. The paintComponent Method
    3. Some Methods of the Graphics Class
    4. Creating a Drawing Area
    5. Drawing Area Source Code
  • Chapter 8: Printing
    1. Printing Basics
    2. A Printing Example
    3. Using the Book Class
  • Chapter 9: Layout Managers
    1. Introduction
    2. FlowLayout
    3. GridLayout
    4. BorderLayout
    5. CardLayout
    6. GridBagLayout
    7. GridBagConstraints
    8. BoxLayout
    9. OverlayLayout
  • Chapter 10: Models, Views, and Controllers
    1. Introduction
    2. The MVC Process of JButton
    3. Advantages to using the MVC Architecture
    4. Pluggable Look and Feel
    5. An MVC Example
    6. Linking the Components
    7. MVC Diagram
    8. ListModel
    9. AbstractListModel
    10. JTable
    11. TableModel
    12. MVCList Source Code
  • Chapter 11: Using the JTree
    1. Tree Basics
    2. The DefaultMutableTreeNode
    3. DefaultTreeModel
    4. Constructing a JTree
    5. Customizing the JTree
    6. Tree Listeners
  • Chapter 12: Text Components
    1. Various Text Components of Swing
    2. JTextField
    3. JPasswordField
    4. JTextArea
    5. Using a JScrollPane
    6. JTextPane
    7. StyleConstants
    8. StyleTest Source Code
  • Chapter 13: Utility Panes, Borders, and Focus
    1. Various Utility Panes
    2. JTabbedPane
    3. JSplitPane
    4. JFileChooser
    5. JOptionPane
    6. Using Borders
  • Chapter 14: Creating Custom Components
    1. Extending JComponent
    2. Creating RButton
    3. RButton's Model to View
    4. The Constructor
    5. More with Listeners
    6. RButton Source Code
  • Chapter 15: Clipboard and Drag & Drop
    1. Clipboard
    2. DataFlavors
    3. System Clipboard vs. Custom Clipboard
    4. More with DataFlavors
    5. Drag & Drop
  • Appendix A: Events and Their Listeners
    1. AWT Events
    2. Swing Events
  • Appendix B: Accessibility
    1. Accessible Applications
    2. The ADA and Section 508 Regulations
    3. Accessibility Needs
    4. Java Support for Accessibility
    5. The Java Accessibility API
    6. AccessibleContext
    7. Section 508 Accessibility Standards
    8. Section 1194.21 (a) - Keyboard Access
    9. Section 1194.21 (b) - Accessibility Features
    10. Section 1194.21 (c) - Input Focus
    11. Section 1194.21 (d) - Object Information
    12. Section 1194.21 (e) – Bitmap Images
    13. Section 1194.21 (f) – Textual Information
    14. Section 1194.21 (g) – User Selected Attributes
    15. Section 1194.21 (h) – Animation
    16. Section 1194.21 (i) – Color Coding
    17. Section 1194.21 (j) – Color and Contrast
    18. Section 1194.21 (k) – Flicker Rate
    19. Section 1194.21 (l) – Electronic Forms
    20. The Java Accessibility Bridge
    21. Resources