You are previewing Graphic Java™ 2, Volume II: Swing, Third Edition.
O'Reilly logo
Graphic Java™ 2, Volume II: Swing, Third Edition

Book Description


7966G-2

Master the Java Foundation Classes with Graphic Java 2, the most complete and comprehensive guide to the AWT, Swing, and the 2D API

VOLUME 2: SWING (This is a 2 Volume set)

Swing gives Java application programmers world-class tools for building professional, customizable cross-platform GUIs. This comprehensive reference by former Sun engineer David Geary shows experienced programmers how to take full advantage of Swing's power. Practical explanations and robust code examples provide the resources you need to build Java applications with sophisticated graphical user interfaces.

Graphic Java is the one exhaustive reference that contains everything you need to know about Swing. In depth explanations are coupled with class diagrams and code examples for all of the key components, including:

  • Buttons and labels

  • Progress bars and sliders

  • Frames, windows, and dialogs

  • Internal frames and desktop panes

  • Color and file choosers

  • Menus and toolbars

  • Lists and combo boxes

  • Text components

  • Tables and trees

  • You'll discover the key design considerations associated with Swing development, including Swing's object-oriented idioms and design patterns, and the pluggable look and feel architecture. You will understand how to use the Swing components, but more importantly you will have an understanding of how the components are designed and how they fit together within the Swing framework.

    Table of Contents

    1. Copyright
      1. Dedication
    2. Foreword
    3. Preface
      1. Audience
      2. How To Use This Book
        1. Component Summaries
          1. Component Summary 13-1 JScrollPane
        2. Properties
          1. Events
          2. Class Summaries
          3. Class Summary 13-2 JScrollPane
          4. Constructors
          5. Methods
            1. Creation Methods
      3. Swing Bugs
      4. Using the CDROM
        1. Swing and The JDK
        2. Code Examples From the Book
        3. Applets Vs. Applications
      5. Conventions Used in This Book
    4. Acknowledgments
    5. 1. Swing Fundamentals
      1. 1. Introduction
        1. Swing History
        2. Lightweight Vs. Heavyweight Components
        3. Swing Components
          1. AWT Replacement Components
          2. Additional Swing Components
        4. J Components
          1. Pluggable Look and Feel
        5. An Overview of the Swing Packages
        6. Swing and the AWT
          1. Peers Vs. Pluggable Look and Feel
        7. Getting Started
          1. Using Swing With Internet Browsers
            1. Netscape Navigator
            2. Internet Explorer
            3. Java Plug-in
        8. Swing Resources
        9. Parting Shots
      2. 2. Swing Basics
        1. Applets and Applications
          1. Applets
          2. The JApplet Class
            1. Class Summary 2-1 JApplet
              1. Constructors
              2. Methods
              3. Methods Overridden from java.awt.Container
              4. Root Pane / Content Pane / Glass Pane
              5. Accessible Context / Menu Bar / Key Events / Updating
          3. Applications
          4. The JFrame Class
            1. Class Summary 2-2 JFrame
              1. Constructors
              2. Methods that Overlap With JApplet
              3. Frame Initialization / Default Close Operation / Window Events
          5. Applet/Application Combinations
        2. GJApp
        3. Mixing Swing and AWT Components
          1. Zorder
          2. Swing Popup Menus
          3. Scrolling
          4. Internal Frames
        4. Swing and Threads
          1. Ramifications of Swing's Single-Threaded Design
          2. SwingUtilities invokeLater and invokeAndWait Methods
            1. SwingUtilities.invokeLater
            2. SwingUtilities.invokeAndWait
        5. Parting Shots
      3. 3. Swing Component Architecture
        1. Classic Model-View-Controller Architecture
          1. Pluggable Views and Controllers
          2. View Updates
        2. Swing MVC
          1. Swing Components
            1. Model Pass-Through Methods
            2. Model Event Forwarding
          2. A Static Perspective
          3. A Dynamic Perspective
            1. Scenarios
          4. Models
            1. Model Events
            2. Swing Models
            3. Multiple Views for a Single Model
            4. Lightweight Event Notification
            5. Interface Summary 3-1 ChangeListener
            6. Class Summary 3-1 ChangeEvent
              1. Constructors
            7. Stateful Event Notification
            8. Property Change Notification
            9. Interface Summary 3-2 PropertyChangeListener
            10. Class Summary 3-2 PropertyChangeEvent
              1. Constructors
              2. Methods
          5. UI Delegates
          6. Component UI Scenarios
            1. UI Delegate Painting
            2. Installing a UI Delegate
            3. The ComponentUI Class
            4. Class Summary 3-3 javax.swing.plaf.ComponentUI
              1. Constructors
              2. Methods
              3. UI Creation
              4. Installing / Uninstalling
              5. Painting / Updating / Hit Detection
              6. Component Size
            5. Custom UI Delegates
          7. Listeners
            1. Custom Listeners
        3. Parting Shots
      4. 4. The JComponent Class
        1. An Overview of the JComponent Class
          1. Borders
          2. Accessibility Support
          3. Double Buffering
          4. Debug Graphics
          5. AutoScrolling
          6. Tooltips
          7. Keystroke Handling and Client Properties
        2. The JComponent Class
          1. Swing Components Are AWT Containers
          2. Minimum, Maximum, and Preferred Sizes
        3. Rendering JComponents
          1. Custom Painting in Swing Components
          2. Overriding Paint Methods in AWT Components
          3. Overriding Paint Methods in Swing Components
          4. Paint, Repaint, and Update Methods
          5. Validate, Invalidate, and Revalidate Methods
          6. Opaque vs. Transparent Components
          7. Immediate Painting of Swing Components
        4. Double Buffering
          1. Double Buffering in Custom Components
        5. Debug Graphics
        6. Autoscrolling
          1. Autoscrolling in Custom Components
        7. Tooltips
          1. Tooltips Based on Mouse Position
          2. Preferred Locations for Tooltips
          3. Customizing Tooltip Behavior
          4. Customizing Tooltip Look and Feel
        8. Keystroke Handling
        9. Client Properties
        10. Focus Management
          1. JComponent Focus Properties
          2. Focus Manager
        11. Accessibility
        12. Parting Shots
      5. 5. Borders, Icons, and Actions
        1. Borders
          1. Borders and Insets
          2. Swing Border Types
          3. Opaque vs. Transparent Borders
          4. The Border Package
          5. The Border Interface
            1. Interface Summary 5-1 swing.border.Border
          6. The AbstractBorder Class
            1. Class Summary 5-1 swing.border.AbstractBorder
              1. Constructors
              2. Methods
          7. The Border Factory-Sharing Borders
          8. Replacing Built-in Borders
          9. Implementing Custom Borders
        2. Icons
          1. Interface Summary 5-2 Icon
          2. Associating an Icon with a Component
          3. Sharing Icons Among Components
          4. Image Icons
            1. Class Summary 5-2 ImageIcon
              1. Constructors
              2. Methods
              3. Icon Interface Methods
              4. Description / Image
          5. Animated Image Icons
        3. Actions
          1. Interface Summary 5-3 Action
            1. Constants
            2. Methods
          2. Actions as a Central Point of Control
          3. Action Constants
        4. Parting Shots
      6. 6. Utilities
        1. Timers
          1. The Timer Class
            1. Class Summary 6-1 Timer
              1. Constructors
              2. Methods
              3. Log Timers
              4. Start / Stop / Restart
              5. Delays
              6. Coalesce / Repeating / Running
        2. Event Listener Lists
          1. The EventListenerList Class
            1. Class Summary 6-2 swing.EventListenerList
              1. Constructors
              2. Methods
              3. Add/Remove Listeners
              4. Listener Count
              5. Listener List / String Representation
        3. Swing Utilities
          1. Class Summary 6-3 SwingUtilities
            1. Constructors
            2. Methods
            3. Computational Methods
            4. Conversion Methods
            5. Accessibility Methods
            6. Focus Owners / Ancestors / Root Pane / Window
            7. Invoking Runnable Objects
            8. Descendants / Event Dispatch Thread
            9. Mouse Buttons
            10. Compound Labels / Painting / Updating Component Tree UI
        4. Swing Constants
          1. Interface Summary 6-1 SwingConstants
            1. Constants
        5. BoxLayout and the Box Class
          1. BoxLayout
          2. The Box Class
            1. Class Summary 6-4 Box
              1. Constructors
              2. Methods
              3. Boxes and Box Substances
              4. Layout Manager / Accessible Context
        6. Progress Monitoring
          1. ProgressMonitor
            1. Class Summary 6-5 ProgressMonitor
              1. Constructors
              2. Methods
          2. ProgressMonitorInputStream
            1. Class Summary 6-6 ProgressMonitorInputStream
              1. Constructors
              2. Methods
        7. Undo/Redo
          1. Interface Summary 6-2 UndoableEdit
            1. Undo / Redo
            2. Presentation Names
            3. Coalescing Edits
            4. Significance
          2. A Simple Undo/Redo Example
          3. UndoableEditSupport
          4. Compound Edits
          5. UndoManager
          6. State Edits
        8. Parting Shots
      7. 7. Pluggable Look and Feel
        1. Look-and-Feel Architecture
          1. Look and Feels
          2. The LookAndFeel Class
            1. Class Summary 7-1 LookAndFeel
              1. Constructors
              2. Methods
              3. Initialization / toString()
              4. Installing Borders, Colors and Fonts
              5. Defaults
              6. Descriptive Properties
              7. Static Convenience Methods
          3. Look-and-Feel Defaults
          4. The UIDefaults Class
            1. Class Summary 7-2 UIDefaults
              1. Constructors
              2. Methods
              3. Property Change Events
              4. Property Insertion Methods
              5. Property Accessor Methods
          5. Active and Lazy Values
          6. UI Manager
          7. UI Defaults Access
          8. Look-and-Feel Access
          9. Setting the Look and Feel
            1. Class Summary 7-3 UIManager
              1. Constructors
              2. Methods
              3. Property Change Listeners
              4. Defaults
              5. Look and Feels
          10. UI Resources
        2. The Java Look & Feel
          1. Client Properties
            1. Themes
        3. Auxiliary UIs
        4. Parting Shots
    6. 2. Swing Components
      1. 8. Labels and Buttons
        1. JLabel and JButton
        2. JLabel
          1. Content Alignment
          2. Text Position
          3. Icon/Text Gap
          4. Enabled State
          5. Component Summary 8-1 JLabel
          6. JLabel Properties
          7. JLabel Events
          8. JLabel Class Summaries
            1. Class Summary 8-1 JLabel
              1. Constructors
              2. Methods
              3. Verification
              4. Alignment and Text Position
              5. Property Accessors
              6. Accessibility / Pluggable Look and Feel
        3. Buttons
          1. Button Class Hierarchy
        4. JButton
          1. Component Summary 8-2 JButton
          2. JButton Properties
          3. JButton Events
            1. Interface Summary 8-1 ActionListener
            2. Class Summary 8-2 ActionEvent
              1. Constants
              2. Constructors
              3. Methods
          4. JButton Class Summaries
            1. Class Summary 8-3 JButton
              1. Constructors
              2. Methods
              3. Accessibility / Pluggable Look and Feel
              4. Default Button
            2. Class Summary 8-4 AbstractButton
              1. Constructors
              2. Methods
              3. Verification
              4. Action and Item Listeners
              5. Initialization / Border
              6. Programmatic Activation
              7. Icons
              8. Boolean Property Accessors
              9. Property Accessors
            3. Content Alignment and Text Position
            4. Button Margins
            5. Button Mnemonics
          5. AWT Compatibility
        5. Parting Shots
      2. 9. Toggle Buttons, Check Boxes, and Radio Buttons
        1. JToggleButton
          1. Component Summary 9-1 JToggleButton
          2. JToggleButton Properties
          3. JToggleButton Events
            1. Interface Summary 9-1 ItemListener
            2. Class Summary 9-1 ItemEvent
              1. Constants
              2. Constructors
              3. Methods
          4. JToggleButton Class Summaries
            1. Class Summary 9-2 JToggleButton
              1. Constructors
              2. Methods
          5. AWT Compatibility
        2. Button Groups
          1. Class Summary 9-3 ButtonGroup
            1. Constructors
            2. Methods
        3. Check Boxes
          1. Component Summary 9-2 JCheckBox
          2. JCheckBox Properties
          3. JCheckBox Events
          4. JCheckBox Class Summaries
            1. Class Summary 9-4 JCheckBox
              1. Constructors
              2. Methods
            2. AWT Compatibility
        4. Radio Buttons
          1. Component Summary 9-3 JRadioButton
          2. JRadioButton Properties
          3. JRadioButton Events
          4. JRadioButton Class Summaries
            1. Class Summary 9-5 JRadioButton
              1. Constructors
              2. Methods
          5. AWT Compatibility
        5. Parting Shots
      3. 10. Menus and Toolbars
        1. Menus, Menu Bars, and Toolbars
        2. Menus and Popup Menus
        3. JMenuItem
          1. Menu Item Accelerators and Mnemonics
            1. Component Summary 10-1 JMenuItem
          2. JMenuItem Properties
          3. JMenuItem Events
            1. Menu Change Events
            2. Menu Drag-Mouse Events
            3. Interface Summary 10-1 MenuDragMouseListener
            4. Class Summary 10-1 MenuDragMouseEvent
              1. Constructors
              2. Methods
          4. JMenuItem Class Summaries
            1. Class Summary 10-2 JMenuItem
              1. Constructors
              2. Methods
              3. Initialization
              4. The MenuElement Interface
              5. Accelerators / Arming / Enabling
              6. Listeners / Event Firing
              7. Accessibility / Pluggable Look And Feel
          5. AWT Compatibility
        4. JCheckBoxMenuItem
          1. Component Summary 10-2 JCheckBoxMenuItem
          2. JCheckBoxMenuItem Properties
          3. JCheckBoxMenuItem Events
          4. JCheckBoxMenuItem Class Summaries
            1. Class Summary 10-3 JCheckBoxMenuItem
              1. Constructors
              2. Initialization and State
              3. Accessibility / Pluggable Look And Feel
          5. AWT Compatibility
        5. JRadioButtonMenuItem
          1. Component Summary 10-3 JRadioButtonMenuItem
          2. JRadioButtonMenuItemProperties
          3. JRadioButtonMenuItem Events
          4. JRadioButtonMenuItemClass Summaries
            1. Class Summary 10-4 JRadioButtonMenuItem
              1. Constructors
              2. Methods
              3. Initialization / Request Focus
              4. Accessibility / Pluggable Look And Feel
          5. AWT Compatibility
        6. JMenu
          1. Dynamically Modifying Menus
          2. Pull-right Menus
            1. Component Summary 10-4 JMenu
          3. JMenu Properties
          4. JMenu Events
            1. Interface Summary 10-2 MenuListener
          5. JMenu Class Summaries
            1. Class Summary 10-5 JMenu
              1. Constructors
              2. Methods
              3. Listeners
              4. Populating
              5. Popup Menu Components
              6. Property Accessors
              7. MenuElement Interface
              8. Listeners / Event Firing
              9. Accessibility / Pluggable Look And Feel
          6. AWT Compatibility
        7. Menu Elements
          1. Interface Summary 10-3 MenuElement
          2. Implementing the MenuElement Interface
        8. JPopupMenu
          1. Popup Trigger
          2. Light/Medium/HeavyWeight Popup Menus
          3. Popup Menu Invokers
            1. Component Summary 10-5 JPopupMenu
          4. JPopupMenu Properties
          5. JPopupMenu Events
            1. Interface Summary 10-4 PopupMenuListener
          6. JPopupMenu Class Summaries
            1. Class Summary 10-6 JPopupMenu
              1. Constructors
              2. Methods
              3. Lightweight Popups
              4. Adding and Inserting Objects
              5. Listeners / Event Firing
              6. Property Accessors
              7. MenuElement Interface
              8. Show / Pack / Paint Border
              9. Accessibility / Pluggable Look And Feel
          7. AWT Compatibility
        9. JMenuBar
          1. Menu Bar Menus and Components
            1. Component Summary 10-6 JMenuBar
          2. JMenuBar Properties
          3. JMenuBar Events
          4. JMenuBar Class Summaries
            1. Class Summary 10-7 JMenuBar
              1. Constructors
              2. Methods
              3. Menus
              4. Components
              5. Margin / Selection Model / Border Painting / Managing Focus
              6. MenuElement Interface
              7. Accessibility / Pluggable Look And Feel
          5. AWT Compatibility
        10. JToolBar
          1. Rollover Toolbars
          2. Using Actions with Toolbars
          3. Floating Toolbars
          4. Toolbar Buttons with Fixed-Location Tooltips
            1. Component Summary 10-7 JToolBar
          5. JToolBar Properties
          6. JToolbar Events
          7. JToolBar Class Summaries
            1. Class Summary 10-8 JToolBar
              1. Constructors
              2. Methods
              3. Orientation
              4. Action Change Listener
              5. Add / Remove
              6. Property Accessors
              7. Accessibility / Pluggable Look And Feel
          8. AWT Compatibility
        11. Parting Shots
      4. 11. Progress Bars, Sliders, and Separators
        1. JProgressBar
          1. Progress Bars and Threads
            1. Component Summary 11-1 JProgressBar
          2. JProgressBar Properties
          3. JProgressBar Events
          4. JProgressBar Class Summaries
            1. Class Summary 11-1 JProgressBar
              1. Constructors
              2. Methods
              3. State Changes
              4. Progress Bar String
              5. Updating
              6. Miscellaneous Properties
              7. Accessibility / Pluggable Look And Feel
          5. AWT Compatibility
        2. JSlider
          1. Filled Sliders
          2. Slider Tick Marks
          3. Slider Labels
            1. Custom Slider Labels
          4. Inverting Slider Values
          5. Slider Extent
            1. Component Summary 11-2 JSlider
          6. JSlider Properties
          7. JSlider Events
          8. JSlider Class Summaries
            1. Class Summary 11-2 JSlider
              1. Constructors
              2. Methods
              3. Change listeners / Firing Change Events
              4. Standard Labels
              5. Property Accessors
              6. Convenience Methods
              7. Accessibility / Pluggable Look And Feel
          9. AWT Compatibility
        3. JSeparator
          1. Separators and Boxes
            1. Component Summary 11-3 JSeparator
          2. JSeparator Properties
          3. JSeparator Events
            1. Class Summary 11-3 JSeparator
              1. Constructors
              2. Orientation / Focus Traversable / Param String
              3. Accessibility / Pluggable Look And Feel
          4. AWT Compatibility
        4. Parting Shots
      5. 12. Lightweight Containers
        1. JPanel
          1. Component Summary 12-1 JPanel
          2. JPanel Properties
          3. JPanel Events
          4. JPanel Class Summaries
            1. Class Summary 12-1 JPanel
              1. Constructors
              2. Methods
          5. AWT Compatibility
        2. JRootPane
          1. The RootPaneContainer Interface
            1. Interface Summary 12-1.RootPaneContainer
          2. Glass Panes
          3. Content Panes
            1. Component Summary 12-2.JRootPane
          4. JRootPane Properties
          5. JRootPane Events
          6. JRootPane Class Summaries
            1. Class Summary 12-2 JRootPane
              1. Constructors
              2. Methods
              3. Initialization
              4. ContentPane/GlassPane/LayeredPane/MenuBar/DefaultButton Accessors
              5. Focus Cycle and Validate Roots
              6. Miscellaneous Methods
          7. AWT Compatibility
        3. JLayeredPane
          1. Zorder for Lightweight Components Revisited
          2. Assigning Layers to Components
          3. Positioning Components on the Same Layer
          4. Using the Drag Layer
            1. Component Summary 12-3 JLayeredPane
          5. JLayeredPane Properties
          6. JLayeredPane Class Summaries
            1. Class Summary 12-3 JLayeredPane
              1. Constructors
              2. Methods
              3. Static Methods
              4. Adding Components / Components and Layers
              5. Painting / Layer Access
              6. Index / Layer / Position
              7. Setting Layers and Positions / Moving/Removing Components
              8. AccessibleContext / Param String
          7. AWT Compatibility
        4. JTabbedPane
          1. Tab Placement
            1. Component Summary JTabbedPane
          2. JTabbedPane Properties
          3. JTabbedPane Events
          4. JTabbedPane Class Summaries
            1. Class Summary 12-4 JTabbedPane
              1. Constructors
              2. Methods
              3. Adding / Removing Tabs and Components
              4. Property Accessors
              5. Change Listeners
              6. Accessibility / Pluggable Look And Feel
        5. JSplitPane
          1. Component Summary 12-5 JSplitPane
          2. JSplitPane Properties
          3. JSplitPane Events
          4. JSplitPane Class Summaries
            1. Class Summary 12-5 JSplitPane
              1. Constructors
              2. Methods
              3. Adding Components / Painting Children
              4. Removing Components
              5. Property Accessors
              6. Accessibility / Pluggable Look And Feel
          5. AWT Compatibility
        6. Parting Shots
      6. 13. Scrolling
        1. JViewport
          1. Dragging a Viewport's View
          2. Using the scrollRectToVisible Method
            1. Component Summary 13-1 JViewport
          3. JViewport Properties
          4. JViewport Events
          5. JViewport Class Summaries
            1. Class Summary 13-1 JViewport
              1. Constructors
              2. Methods
                1. Change Events
                2. Protected Utility Methods
                3. Property Accessors
                4. Painting / Removing / Reshaping
                5. View Coordinates / Scrolling
                6. Accessibility and Pluggable Look and Feel
          6. AWT Compatibility
        2. JScrollPane
          1. Scrollpane Headers
            1. Header Views
            2. Header Viewports
          2. Scrollpane Corners
            1. Component Summary 13-2 JScrollPane
          3. JScrollPane Properties
          4. JScrollPane Events
          5. JScrollPane Class Summaries
            1. Interface Summary 13-1 ScrollPaneConstants
              1. Constants
                1. ScrollBar Display Policies
                2. Corner Constants
            2. Class Summary 13-2 JScrollPane
              1. Constructors
              2. Methods
                1. Creation Methods
                2. Property Accessors
                3. Accessibility / Pluggable Look And Feel
            3. Opaque vs. Transparent Scrollpanes
          6. AWT Compatibility
        3. The Scrollable Interface
          1. Interface Summary 13-2 Scrollable
        4. JScrollBar
          1. Manual Scrolling with Swing's JScrollBar Class
          2. Block and Unit Increments
            1. Component Summary 13-3 JScrollBar
          3. JScrollBar Properties
          4. JScrollBar Events
            1. Class Summary 13-3 java.awt.AdjustmentEvent
              1. Constants
              2. Constructors
              3. Methods
          5. JScrollBar Class Summaries
            1. Class Summary 13-4 JScrollBar
              1. Constructors
              2. Methods
                1. Adjustment Events
                2. Property Accessors
                3. Accessibility and Pluggable Look And Feel
          6. AWT Compatibility
        5. Parting Shots
      7. 14. Windows and Dialogs
        1. JWindow
          1. Component Summary 14-1 JWindow
          2. JWindow Properties
          3. JWindow Class Summaries
            1. Class Summary 14-1 JWindow
              1. Constructors
              2. Methods
                1. Root Pane / Adding Components / Setting Layout Manager
                2. RootPaneContainer Methods
                3. Accessible Context
          4. AWT Compatibility
        2. JDialog
          1. Component Summary 14.2 JDialog
          2. JDialog Properties
          3. JDialog Class Summaries
            1. Class Summary 14-2 JDialog
              1. Constructors
              2. Methods
                1. Root Pane / Adding Components / Window Events
                2. Default Close Operation / Menu Bar / Layout Manager
                3. RootPaneContainer Methods
                4. Relative Location / Updating
                5. Accessible Context
          4. AWT Compatibility
        3. JOptionPane
          1. Internal Frames
          2. Creating Dialogs with JOptionPane Static Methods
          3. Message Dialogs
          4. Confirmation Dialogs
          5. Input Dialogs
          6. Option Dialogs
            1. Component Summary 14-3 JOptionPane
          7. JOptionPane Properties
          8. JOptionPane Events
          9. JOptionPane Class Summaries
            1. Class Summary 14-3 JOptionPane
              1. Constants
                1. Option Types
                2. Button Configuration Options
                3. Message Types
                4. Properties
              2. Constructors
                1. Static Convenience Methods
                2. Confirmation Dialog
                3. Input Dialog
                4. Message Dialog
                5. Option Dialog
                6. Creating Dialog and Internal Frames / Icon
                7. Property Accessors
                8. Initial Value
                9. Update/Set UI
          10. AWT Compatibility
        4. Parting Shots
      8. 15. Internal Frames and Desktop Panes
        1. JInternalFrame
          1. Component Summary 15-1 JInternalFrame
          2. JInternalFrame Properties
          3. JInternalFrame Events
            1. Internal Frame Events
            2. Interface Summary 15-1 Internal FrameListener
            3. Class Summary 15-1 InternalFrameEvent
              1. Constants
              2. Constructors
              3. Methods
            4. JInternalFrame Constrained Properties
            5. Class Summary 15-2 JInternalFrame
              1. Constructors
              2. Methods
              3. Layout Manager / Root Pane / Adding Components
              4. Internal Frame Events
              5. Foreground and Background Colors
              6. Vetoable Property Accessors
              7. Properties
              8. Show / Move Front-Back / Reshape / Dispose
              9. Accessibility / Pluggable Look And Feel
          4. AWT Compatibility
        2. JDesktopPane
          1. Component Summary 15-2 JDesktopPane
          2. JDesktopPane Properties
          3. JDesktopPane Events
          4. JDesktopPane Class Summaries
            1. Class Summary 15-3 JDesktopPane
              1. Constructors
              2. Methods
              3. Property Accessors
              4. Accessibility / Pluggable Look and Feel
          5. AWT Compatibility
        3. DesktopManager
          1. DesktopManager Class Summaries
            1. Class Summary 15-4 DefaultDesktopManager
              1. Constructors
              2. Methods
              3. DesktopManager Methods
              4. Protected Utility Methods
        4. Parting Shots
      9. 16. Choosers
        1. JFileChooser
          1. Feature Summary 16-1 JFileChooser
            1. Open/Save/Custom Dialogs
            2. Display Modes
            3. Multiple Selection
            4. Approve Button
            5. File Filters
            6. File Views
            7. Accessory Component
          2. File Chooser Types
          3. Accessory Components
          4. Filtering File Types
            1. Class Summary 15-5 fileFilter
              1. Constructors
              2. Methods
          5. Choosable Filters
          6. File Views
            1. Class Summary 15-6 FileView
              1. Constructors
              2. Methods
                1. Icon / Name / Is Traversable
                2. File Type and Description
          7. Multiple Selection
            1. Component Summary 16-1 JFileChooser
          8. JFileChooser Properties
            1. Class Summary 15-7 FileSystemView
              1. Constructors
              2. Methods
          9. JFileChooser Events
          10. Action Events
          11. JFileChooser Class Summaries
            1. Class Summary 15-8 JFileChooser
              1. Constants
                1. Dialog Types
                2. Modes
                3. Options / Approve-Cancel
              2. Constructors
              3. Methods
                1. Accessory Component
                2. Approve Button
                3. Boolean Properties
                4. Dialogs
                5. Files and Directories
                6. File Filters
                7. FileViews
                8. FileSystemView
                9. Listeners
                10. Programmatic Manipulation
                11. File Selection Mode
                12. Multiple Selection and Selected Files
                13. Accessibility / Pluggable Look and Feel
          12. AWT Compatibility
        2. JColorChooser
          1. Feature Summary 16-1 JColorChooser
            1. Color Chooser Panels
            2. Preview Panel
            3. Prefabricated Dialogs
          2. Displaying Color Choosers In Dialogs
          3. Showing Color Chooser Dialogs
          4. Creating Color Chooser Dialogs
          5. Customizing Color Choosers
          6. Preview Panels
          7. Color Chooser Panels
            1. Class Summary 15-9 AbstractColorChooserPanel
              1. Constructors
              2. Methods
                1. Color/Color Selection Model / Installing Chooser Panel / Painting
                2. Building and Updating Chooser
                3. Display Names and Icons
            2. Component Summary 16-2 JColorChooser
          8. JColorChooser Properties
          9. JColorChooser Events
          10. JColorChooser Class Summaries
            1. Class Summary 15-10 JColorChooser
              1. Constants
              2. Constructors
              3. Methods
                1. Creating and Showing Color Chooser Dialogs
                2. Chooser Panels
                3. Color and Color Selection Model
                4. Preview Panels
                5. Accessibility / Pluggable Look and Feel
          11. AWT Compatibility
        3. Parting Shots
      10. 17. Lists
        1. List Models
          1. Interface Summary 17-1 ListModel
            1. ListDataListener Registration
            2. List Size and Element Accessors
          2. AbstractListModel
            1. Class Summary 17-1 AbstractListModel
              1. Constructors
              2. Methods
          3. DefaultListModel
            1. Class Summary 17-2.DefaultListModel
              1. Constructors
              2. Methods
        2. List Selections
          1. Interface Summary 17-2 ListSelectionModel
            1. Constants
            2. Methods
        3. List Cell Renderers
          1. Interface Summary 17-3.ListCellRenderer
          2. Class Summary 17-3.DefaultListCellRenderer
            1. Constructors
            2. Methods
          3. Component Summary 17-1 JList
          4. JList Properties
          5. JList Events
            1. List Selection Events
            2. Interface Summary 17-4 ListSelectionListener
            3. Class Summary 17-4 ListSelectionEvent
              1. Constructors
              2. Methods
              3. List Data Events
            4. Interface Summary 17-5 ListDataListener
            5. Class Summary 17-5 ListDataEvent
              1. Constants
              2. Constructors
              3. Methods
            6. Handling Double and Triple Mouse Clicks
          6. JList Class Summaries
            1. Class Summary 17-6 JList
              1. Constructors
              2. List Selection Events
              3. List Selection
              4. Scrollable Methods
              5. Prototype Cell and Fixed Width and Height
              6. Property Accessors
              7. Item Indexes and Locations
              8. Accessibility / Pluggable Look and Feel
          7. AWT Compatibility
        4. Parting Shots
      11. 18. Combo Boxes
        1. JComboBox vs. JList
        2. The JComboBox Component
        3. Combo Box Models
          1. ComboBoxModel
            1. Interface Summary 18-1 ComboBoxModel
          2. MutableComboBoxModel
            1. Interface Summary 18-2 MutableComboBoxModel
          3. DefaultComboBoxModel
            1. Class Summary 18-1 DefaultComboBoxModel
              1. Constructors
              2. Methods
                1. Elements / Size
                2. Selected Item / Indexes
        4. Combo Box Cell Renderers
        5. Combo Box Key Selection Managers
          1. Interface Summary 18-3 JComboBox.KeySelectionManager
          2. Using the Default Key Selection Manager
          3. Custom Key Selection Managers
          4. Programmatic Key Selection
        6. Combo Box Editors
          1. Interface Summary 18-4 ComboBoxEditor
            1. Action Listener Registration
            2. Editor Component
            3. Items
          2. Component Summary 18-1 JComboBox
          3. JComboBox Properties
          4. JComboBox Events
            1. Selection Events
            2. Editing Events
          5. JComboBox Class Summaries
            1. Class Summary 18-2 JComboBox
              1. Constructors
              2. Methods
                1. Methods Defined by ActionListener/ItemListener/ListDataListener
                2. Combo Box Delegates: Editor/Key Selection Manager/Model/Renderer
                3. Item Methods
                4. Event/Listener Methods
                5. Popup Menu Methods
                6. Property Accessors
                7. Accessibility / Pluggable Look and Feel
          6. AWT Compatibility
        7. Parting Shots
      12. 19. Tables
        1. Tables and Scrolling
          1. Block and Unit Increments
        2. Table Models
          1. Table Data Models
          2. The TableModel Interface
            1. Interface Summary 19-1 TableModel
              1. TableModelListener Registration
              2. Cell Values and Editability
              3. Columns and Rows
          3. AbstractTableModel
            1. Class Summary 19-1 AbstractTableModel
              1. Methods
              2. Table Model Listeners
              3. Columns
              4. Cells and Values
              5. Event Firing
          4. DefaultTableModel
            1. Class Summary 19-2 DefaultTableModel
              1. Constructors
              2. Methods
              3. Data
              4. Columns
              5. Rows
          5. Table Models and Default Renderers and Editors
        3. Table Columns
          1. Column Resize Modes
          2. Column Widths
            1. Class Summary 19-3 TableColumn
              1. Constructors
              2. Methods
              3. Cell Editors
              4. Cell Renderers
              5. Header Renderer
              6. Header Value
              7. Property Change Listeners
              8. Preferred/Minimum/Maximum Widths
              9. Identifier / Model Index / Resizable
              10. Utility Methods
        4. Table Column Models
          1. Interface Summary 19-2 TableColumnModel
            1. Listener Registration
            2. Adding/Removing/Moving Columns
            3. Column Selection
            4. Miscellaneous Column Properties
          2. The DefaultTableColumnModel Class
          3. Column Margins
          4. Hiding Columns
          5. Locking the Left-Hand Column
        5. Table Selection
        6. Rendering and Editing
          1. Using Table Cell Renderers and Editors
          2. Table Cell Rendering
            1. Interface Summary 19-3 TableCellRenderer
            2. DefaultTableCellRenderer
            3. Table Formatting Renderers
            4. Class Summary 19-4 DefaultTableCellRenderer
              1. Constructors
              2. Methods
          3. Cell Editors
            1. Interface Summary 19-4 CellEditor
              1. Cell Editor Listeners
              2. Editing State
              3. Cell Editable/Selectable
              4. Cell Value
          4. Table Cell Editors
            1. Interface Summary 19-5 TableCellEditor
            2. Installing Editor Components
            3. Setting Edited Values
          5. Implementing the TableCellEditor Interface
            1. AbstractCellEditor
            2. Extending AbstractCellEditor
            3. DefaultCellEditor
            4. Class Summary 19-5 DefaultCellEditor
              1. Constructors
              2. Methods
              3. CellEditor Methods
              4. Tree/Table Editor Components
              5. Click Count
              6. Component
              7. Event Firing
        7. Table Rows
          1. Row Height
          2. Rendering By Rows
        8. Table Decorators
          1. Sorting Decorators
        9. Table Headers
          1. JTableHeader
          2. Column Header Renderers and Header ToolTips
            1. Component Summary 19-1 JTable
          3. JTable Properties
          4. Table Events
          5. Table Model Events
            1. Interface Summary 19-6 TableModelListener
            2. Class Summary 19-6 TableModelEvent
              1. Constants
              2. Constructors
              3. Methods
          6. TableColumnModel Events
            1. Interface Summary 19-7 TableColumnModelListener
            2. Class Summary 19-7 TableColumnModelEvent
              1. Constructors
              2. Methods
          7. List Selection Events
          8. JTable Class Summaries
            1. Class Summary 19-8 JTable
              1. Constructors
              2. Methods
              3. Initialization
              4. Tables and Scrollpanes
              5. TableModelListener Method
              6. TableColumnModelListener Methods
              7. ListSelectionListener Method
              8. Scrollable Methods
              9. CellEditorListener Methods
              10. Selection
              11. Table Cell Editing
              12. Table Cell Rendering
              13. Utility Methods
              14. Miscellaneous Properties
              15. Accessibility / Pluggable Look and Feel
          9. AWT Compatibility
        10. Parting Shots
      13. 20. Trees
        1. Creating Trees
        2. Tree Nodes
          1. The TreeNode Interface
            1. Interface Summary 20-1 TreeNode
          2. The MutableTreeNode Interface
            1. Interface Summary 20-2 MutableTreeNode
          3. The DefaultMutableTreeNode class
          4. Using DefaultMutableTreeNode
          5. Extending DefaultMutableTreeNode
          6. An Aside
        3. Tree Paths
          1. Class Summary 20-1 TreePath
            1. Constructors
            2. Methods
        4. Tree Models
          1. Interface Summary 20-3 TreeModel
            1. TreeModelListener Registration
            2. Root Node Accessor / Child Accessors
            3. Leaf Identification / Node Value Changed
          2. DefaultTreeModel
            1. Class Summary 20-2 DefaultTreeModel
              1. Constructors
              2. Methods
                1. TreeModel Methods
                2. Event Firing
                3. Setting Root / Paths to Root / Inserting and Removing Nodes
                4. Notification Methods
                5. Reloading / Asks Allows Children / Is Leaf
        5. Tree Selection
          1. Interface Summary 20-4 TreeSelectionModel
            1. Constants
            2. Methods
              1. Selection Mode
              2. Listeners
              3. Selection Paths
              4. Selection Rows
              5. Utility Methods
          2. DefaultTreeSelectionModel
        6. Tree Cell Rendering
          1. Interface Summary 20-5 TreeCellRenderer
          2. DefaultTreeCellRenderer
            1. Class Summary 20-3 DefaultTreeCellRenderer
              1. Constructors
              2. Methods
                1. Icons
                2. Colors and Font
                3. Painting/Preferred Size / Renderer Component
          3. Using DefaultTreeCellRenderer
          4. Extending DefaultTreeCellRenderer
          5. Tree Formatting Renderers
          6. Metal Look and Feel
          7. Root Nodes and Root Handles
        7. Tree Cell Editing
          1. Interface Summary 20-6 TreeCellEditor
          2. Extending DefaultCellEditor
          3. DefaultTreeCellEditor
            1. Class Summary 20-4 DefaultTreeCellEditor
              1. Constructors
              2. Methods
                1. CellEditor Methods
                2. TreeCellEditor Method
                3. Start Editing
                4. Border Selection Color / Font / Tree Properties
                5. Utility Methods
                6. TreeSelectionListener Method
          4. Using DefaultTreeCellEditor
        8. Rendering and Editing: A Case Study
          1. The Test Class
          2. The SelectableFile and FileNode Classes
          3. The Renderers
          4. FileNodeRenderer
          5. FileNodeEditorRenderer
          6. The Editors
          7. FileNodeEditor
          8. ImmediateEditor
            1. Component Summary 20-1 JTree
          9. JTree Properties
          10. Tree Events
          11. Tree Mouse Events
          12. Tree Editing Events
            1. Interface Summary 20-7 CellEditorListener
          13. Tree Selection Events
            1. Interface Summary 20-8 TreeSelectionListener
            2. Class Summary 20-5 TreeSelectionEvent
              1. Constructors
              2. Methods
          14. Tree Expansion Events
            1. Interface Summary 20-9 TreeExpansionListener
            2. Class Summary 20-6 TreeExpansionEvent
              1. Constructors
              2. Methods
          15. Vetoing Node Expansion and Collapse
            1. Interface Summary 20-10 TreeWillExpandListener
            2. Class Summary 20-7 ExpandVetoException
              1. Constructors
          16. JTree Class Summaries
            1. Class Summary 20-8 JTree
              1. Constants
              2. Constructors
              3. Methods
                1. Scrollable Interface Methods
                2. Tree Model
                3. Tree Selection
                4. Tree Expansion
                5. Tree Cell Editing and Rendering
                6. Tree Paths
                7. Tree Rows
                8. Utility Methods
                9. Accessibility / Pluggable Look and Feel
          17. AWT Compatibility
        9. Parting Shots
      14. 21. Text Fundamentals
        1. Swing Text Components
          1. The Swing Text Package
        2. Actions
          1. Text Actions
            1. Class Summary 21-1 TextAction
              1. Constructors
              2. Methods
          2. Actions and Editor Kits
        3. Keymaps
          1. Interface Summary 21-1 Keymap
            1. Actions
            2. Keystrokes
            3. Resolve Parent / Name
        4. Documents
          1. Interface Summary 21-2.Document
            1. Constants
            2. Methods
              1. Content
              2. Positions
              3. Root Elements
              4. Document and Undoable Edit Listeners
              5. Properties / Rendering
          2. Custom Documents
          3. Document Listeners
            1. Interface Summary 21-3 DocumentListener
            2. Interface Summary 21-4 DocumentEvent
            3. Class Summary 21-2 DocumentEvent.EventType
              1. Constants
              2. Methods
        5. Carets and Highlighters
          1. Carets
            1. Interface Summary 21-5 Caret
              1. Change Listener
              2. Installation
              3. Marks, Dots, and Blink Rate
              4. Painting / Visibility / Selection
              5. Magic Caret Position
          2. Caret Listeners
            1. Interface Summary 21-6 CaretListener
            2. Class Summary 21-3.CaretEvent
              1. Constructors
              2. Methods
          3. Custom Carets
          4. Highlighters
            1. Interface Summary 21-7 Highlighter
              1. Installation
              2. Painting
              3. Highlights
        6. Undo / Redo
        7. JTextComponent
          1. Component Summary 21-1 JTextComponent
          2. JTextComponent Properties
            1. Class Summary 21-4 JTextComponent
              1. Constants
              2. Constructors
              3. Methods
                1. Document / Text
                2. Actions
                3. Keymaps
                4. Carets / Caret Listener Registration
                5. Highlighter
                6. Cut / Copy / Paste
                7. Selection
                8. Reading / Writing
                9. View/Model Transformations
                10. Scrollable Interface Implementation
                11. Miscellaneous Properties
                12. Miscellaneous Methods
                13. Accessibility / Pluggable Look And Feel
        8. Parting Shots
      15. 22. Text Components
        1. JTextField
          1. Horizontal Visibility and Scroll Offset
          2. Laying Out Text Fields
          3. Validating Text Fields
          4. JTextField Component Summary
            1. Components Summary 22-1 JTextField
          5. JTextField Properties
          6. JTextField Events
          7. JTextField Class Summaries
            1. Class Summary 22-1 JTextField
              1. Constants
                1. Constructors
              2. Methods
                1. Action Events
                2. Default Model / Actions / Action Command
                3. Columns / Font
                4. Alignment / Visibility / Scroll Offset
                5. Accessibility / Pluggable Look And Feel
                6. Miscellaneous Methods
          8. AWT Compatibility
        2. JPasswordField
          1. JPasswordField Component Summary
            1. Component Summary 22-2 JPasswordField
          2. JPasswordField Properties
          3. JPasswordField Class Summary
            1. Class Summary 22-2 JPasswordField
              1. Constructors
                1. Password / Security
                2. Echo Char
                3. Accessibility / Pluggable Look And Feel
        3. JTextArea
          1. JTextArea Component Summary
            1. Component Summary 22-3 JTextArea
          2. JTextArea Properties
          3. JTextArea Class Summaries
            1. Class Summary 22-3 JTextArea
              1. Constructors
              2. Methods
                1. Document / Text / Tab Size
                2. Columns and Rows
                3. Lines / Line Wrapping
                4. Scrollable Interface
                5. Miscellaneous Methods
                6. Accessibility / Pluggable Look And Feel
          4. AWT Compatibility
        4. JEditorPane
          1. Component Summary 22-4 JEditorPane
          2. JEditorPane Properties
          3. JEditorPane Events
            1. Interface Summary 22-1 HyperlinkListener
            2. Class Summary 22-4 HyperlinkEvent
              1. Constructors
              2. Methods
          4. JEditorPane Class Summaries
            1. Class Summary 22-5 JEditorPane
              1. Constructors
              2. Methods
                1. Text / Replace Selection
                2. Editor Kits / Content Type
                3. Page / Hyperlink Events
                4. Scrollable Interface
                5. Accessibility / Pluggable Look and Feel
                6. Miscellaneous Methods
        5. JTextPane
          1. Embedding Icons and Components
          2. Marking Content with Attributes
            1. Component Summary 22-5 JTextPane
          3. JTextPane Properties
          4. JTextPane Class Summaries
            1. Class Summary 22-6 JTextPane
              1. Constructors
              2. Methods
                1. Document / Editor Kit / Replacing Selection
                2. Styled Document / Styled Editor Kit
                3. Styles
                4. Icons and Components
                5. Attributes
                6. Miscellaneous Methods
        6. AWT Compatibility
        7. Parting Shots
      16. 23. Customizing Text Components
        1. Overview
        2. Attribute Sets and Style Constants
        3. Custom Actions
        4. Views
          1. Implementing Custom Views
        5. Styles and Style Contexts
        6. Elements
        7. Parting Shots
      17. A. Class Diagrams
        1. Class Diagram Legend
        2. An Example Class Diagram
      18. B. Pluggable Look & Feel Constants