
John Zukowski's Definitive Guide to Swing for Java 2
Résumé
h3 style="margin-top: 0; margin-bottom: 0">Introduction
Development Versions
How This Book Is Structured
Reading the UML Diagrams
Support
Chapter 1 Swing Overview
AWT Component Replacements
New Components
Event Handling and Layout Management
Undo Framework
Using Swing Classes with JDK 1.1
SwingSet Demonstration
JComponent to Page Mapping
Summary
Chapter 2 Event Handling with the Swing Component Set
Delegation-Based Event Handling
Using Event Listeners as Observers
A Quick Look at the JFrame Class
Creating an ExitableJFrame Class
Using SwingUtilities for Mouse Button Identification
Using Property Change Listeners as Observers
Managing Listener Lists
Swing-Specific Event Handling
Interface Action
Class AbstractAction
Class KeyStroke
Using Mnemonics and Accelerators
Swing Focus Management
Examining Focus Cycles
Customizing and Component-Level Focus Management
Setting the Next Focusable Component
Class FocusManager and DefaultFocusManager
Writing Your Own Focus Manager
Multithreaded Swing Event Handling
Using SwingUtilities for Thread Safety
Class Timer
Summary
Chapter 3 The Model-View-Controller Architecture
MVC Communications
Sharing Data Models
Understanding the Predefined Data Models
Summary
Chapter 4 Core Swing Components
Class JComponent
Component Pieces
JComponent Properties
Handling JComponent Events
Class JToolTip
Creating a JToolTip
Creating Customized JToolTip Objects
Displaying Positional ToolTip Text
Customizing JToolTip Look and Feel
Class ToolTipManager
ToolTipManager Properties
Class JLabel
Creating a JLabel
JLabel Properties
Handling JLabel Events
Customizing JLabel Look and Feel
Interface Icon
Creating an Icon
Using an Icon
Class ImageIcon
Class GrayFilter
Class AbstractButton
AbstractButton Properties
Handling AbstractButton Events
Listening to AbstractButton Events with a PropertyChangeListener
Class Button
Creating a JButton
JButton Properties
Handling JButton Events
Listening to JButton Events with an ActionListener
Customizing a JButton Look and Feel
Class JPanel
Creating a JPanel
Using a JPanel
Customizing JPanel Look and Feel
Summary
Chapter 5 Toggle Buttons
Class ToggleButtonModel
Class ButtonGroup
Class JToggleButon
Creating JToggleButton Components
JToggleButton Properties
Handling JToggleButton Selection Events
Customizing a JToggleButton Look and Feel
Class JCheckBox
Creating JCheckBox Components
JCheckBox Properties
Handling JCheckBox Selection Events
Customizing a JCheckBox Look and Feel
Class JRadioButton
Creating JRadioButton Components
JRadioButton Properties
Grouping JRadioButton Componenets in a ButtonGroup
Handling JRadioButton Selections Events
Customizing a JRadioButton Look and Feel
Summary
Chapter 6 Swing Menus and Toolbars
Working with Menus
GettingStarted
Menu Class Hierarchy
Class JMenuBar
SingleSelectionModel Interface
Class JMenuItem
Class JMenu
Class JSeparator
Class JPopupMenu
Class JCheckBoxMenuItem
Class JRadioButtonMenuItem
Creating Custom MenuElement Components
Working with Toolbars: Class JToolBar
Creating JToolBar Components
Adding Components to a JToolBar
JToolBar Propeties
Handling JToolBar Events
Customizing JToolBar Look and Feel
A Complete JToolBar Usage Example
JToolBar.Separator
Summary
Chapter 7 Borders
Some Basics on Working with Borders
Exploring the Border Interface
Introducing BorderFactory
Starting with AbstractBorder
Examining the Predefined Borders
Creating Your Own Borders
Summary
Chapter 8 Root Pane Containers
Class JRootPane
Creating a JRootPane
JRootPane Properties
Interface RootPaneContainer
Class JLayeredPane
Class JFrame
Creating a JFrame
JFrame Properties
Adding Components to a JFrame
Handling JFrame Events
Extending JFrame
Class JWindow
Creating a JWindow
JWindow Properties
Handling JWindow Events
Extending JWindow
Class JDialog
Creating a JDialog
JDialog Properties
Handling JDialog Events
Extending JDialog
Class Japplet
Testing JApplet Solutions
Extending JApplet
Working with a Desktop
Class JInternalFrame
Class JDesktopPane
Summary
Chapter 9 Pop-ups and Choosers
Class JOptionPane
Creating a JOptionPane
Displaying a JOption Pane
Automatically Creating a JOptionPane in a Pop-up Window
JOptionPane Properties
Customizing JOptionPane Look and Feel
Class ProgressMonitor
Creating a ProgressMonitor
Using a ProgressMonitor
ProgressMonitor Properties
Customizing ProgressMonitor Look and Feel
Complete ProgressMonitor Example
Class ProgressMonitorInputStream
Creating a ProgressMonitorInputStream
Using a ProgressMonitorInputStream
ProgessMonitorInputStream Properties
Class JColorChooser
Creating a JColorChooser
Using JColorChooser
Listening for Color Selection Changes
Creating and Showing a JColorChooser Pop-up Window
Providing Your Own OK/Cancel Event Listeners
JColorChooser Properties
Customizing a JColorChooser Look and Feel
Class JFileChooser
Creating a JFileChooser
Using JFileChooser
Adding an ActionListener to a JFileChooser
Creating and Showing a JFileChooser within a Pop-up Window
JFileChooser Properties
Customizing JFileChooser Look and Feel
Summary
Chapter 10 Swing Layout Managers
Class BoxLayout
Creating a BoxLayout
Laying Out Components
Class OverlayLayout
Class SizeRequirements
Class ScrollPaneLayout
Class ViewportLayout
Summary
Chapter 11 Advanced Swing Containers
Class Box
Creating a Box
Box Properties
Working with Box Filler
Creating Areas That Grow
Creating Rigid Areas
Class JSplitPane
Creating a JSplitPane
JSplitPane Properties
Listening for JSplitPane Property Changes
Customizing a JSplitPane Look and Feel
Class JTabbedPane
Creating a JTabbedPane
Adding and Removing Tabs
JTabbedPane Properties
Listening for Changing Tab Selection
Customizing a JTabbedPane Look and Feel
Class JscrollPane
Creating a JScrollPane
Changing the Viewport View
Interface Scrollable
JScrollPane Properties
Customizing a JScrollPane Look and Feel
Class JViewport
Creating a JViewport
JViewport Properties
Scrolling the View
Customizing a JViewport Look and Feel
Summary
Chapter 12 Bounded Range Components
Inteface BoundedRangeModel
Class DefaultBoundedRangeModel
Class JscrollBar
Creating JScrollBar Components
Handling Scrolling Events
JScrollBar Properties
Customizing a JScrollBar Look and Feel
Class JSlider
Creating JSlider Components
Handling JSlider Events
JSlider Properties
Customizing a JSlider Look and Feel
JSlider Client Properties
Class JProgressBar
Creating JProgressBar Components
JProgress Bar Properties
Handling JProgressBar Events
Customizing a JProgressBar Look and Feel
Class JTextField and Interface BoundedRangeModel
Summary
Chapter 13 List Model Controls
Interface ListModel
Class AbstractListModel
Class DefaultListModel
Listening for ListModel Events with a ListDataListener
Interface ComboBoxModel
Interface MutableComboBoxModel
Class DefaultComboBoxModel
Class JList
Creating JList
JList Properites
Scrolling JList Components
Rendering JList Elements
Selecting JList Elements
Customizing JList Look and Feel
DualListBox Example
Class JComboBox
Creating JComboBox Components
JComboBox Properties
Rendering JComboBox Elements
Selecting JComboBox Elements
Editing JComboBox Elements
Customizing a JComboBox Look and Feel
Shared Data Model Example
Summary
Chapter 14 Basic Text Components
Class JTextComponent
JTextComponent Properties
JTextComponent Operations
Class JTextfield
Creating a JTextfield
Using JLabel Mnemonics
JTextField Properties
JTextComponent Operations with a JTextField
Document Interface
Interface DocumentListener/Interface DocumentEvent
Interface Caret and Interface Highlighter
Interface CaretListener/Class CaretEvent
Interface Keymap
Class JTextComponenet.KeyBinding
Handling JTextField Events
Customizing a JTextfield Look and Feel
Class JPasswordField
Creating a JPasswordField
JPasswordField Properties
Customizing a JPasswordField Look and Feel
Class JTextArea
Creating a JTextArea
JTextArea Properties
Handling JTextArea Events
Customizing a JTextArea Look and Feel
Class JEditorPane
Creating a JEditorPane
JEditorPane Properties
Handling JEditorPane Events
Interface HyperlinkListener/Class HyperlinkEvent
Customizing a JEditorPane Look and Feel
Class JTextPane
Creating a JTextPane
JTextPane Properties
Customizing a JTextPane Look and Feel
Sample JText Pane
Summary
Chapter 15 Advanced Text Capabilities
Class TextAction
Listing Actions
Using Actions
Finding Actions
Creating Styled Text
Interface StyledDocument/Class DefaultStyledDocument
Interface AttributeSet
Interface MutableAttributeSet
Class SimpleAttributeSet
Class StyleConstants
Class TabStop and TabSet
Interface Style
Class StyleContext
The Editor Kits
Working with Views
Summary
Chapter 16 Sculpting Trees
Introducing Trees
Class JTree
Creating a JTree
Scrolling Trees
JTree Properties
Customizing a JTree Look and Feel
Interface TreeCellRenderer
Class DefaultTreeCellRenderer
DefaultTreeCellRenderer Properties
Creating a Custom Renderer
Working with Tree Tooltips
Editing Tree Nodes
Interface CellEditor
Interface TreeCellEditor
Class DefaultCellEditor
Class DefualtTreeCellEditor
Creating a Proper ComboBox Editor for a Tree
Creating an Editor Just for Leaf Nodes
Interface CellEditorListener/Class ChangeEvent
Creating a Better Check Box Node Editor
Working with Nodes of the Tree
Interface TreeNode
Interface MutableTreeNode
Class DefaultMutableTreeNode
Traversing Trees
Class JTree.DynamicUtilTreeNode
Dragging Tree Nodes
Interface TreeModel
Class DefaultTreeModel
Interface TreeModelListener/Class TreeModelEvent
Interface TreeSelectionModel
Class DefaultTreeSelectionModel
Interface TreeSelectionListener/Class TreeSelectionEvent
Class TreePath
Additional Expansion Events
Interface TreeExpansionListener/Class TreeExpansionEvent
Interface TreeWillExpandListener/Class ExpandVetoException
Summary
Chapter 17 Tables
Introducing Tables
Class JTable
Creating a JTable
Scrolling JTable Components
Manually Positioning the JTable View
Removing Column Headers
JTable Properties
Rendering Table Cells
Handling JTable Events
Customizing a JTable Look and Feel
Interface TableModel
Class AbstractTableModel
Class DefaultTableModel
Sorting JTable Elements
Interface TableColumnModel
Class DefaultTableColumnModel
Listening to JTable Events with a TableColumnModelListener
Class TableColumn
Class JTableHeader
Creating a JTableHeader
JTableHeader Properties
Using Tooltips
Customizing a JTableHeader Look and Feel
Editing Table Cells
Interface TableCellEditor/Class DefaultCellEditor
Creating a Simple Cell Editor
Creating a Complex Cell Editor
Summary
Chapter 18 Understanding the Pluggable Look and Feel Architecture
Class LookAndFeel
Listing the Installed Look and Feel Classes
Changing the Current Look and Feel
Customizing the Current Look and Feel
Creating a New Look and Feel
Using the MacLookAndFeel on a Non-Macintosh
Adding UI Delegates
Working with Metal Themes
Class MetalTheme
DefaultMetalTheme
Using an Auxiliary Look and Feel
Summary
Chapter 19 Becoming Undone
Working with the Undo Framework
Using the Undo Framework with Swing Text Components
The Command Design Pattern
Interface UndoableEdit
Class AbstractUndoableEdit
Class CompoundEdit
Class UndoManager
A Complete Undoable Program Example
Using the StateEditable Interface and StateEdit Class
Summary
Appendix A UI Manager Properties
Appendix B About the CD-ROM
Loading the CD Contents
What?s on the CD?
Some Tips on Using the CD
For the Java 2 platform
For the Java 1.1 platform
Places to Go for More Information
If You Have Any CD Problems
L'auteur - John Zukowski
John Zukowski wrote the Introduction to the Collections Framework tutorial for Sun's Java Developer Connection. He's also a leading provider of strategic Java training and consulting and a columnist for JavaWorld magazine. Zukowski has written many popular Java titles, including his previous books for Apress, the Definitive Guide to Swing for Java 2, now in its second edition. He also wrote the Java AWT Reference published by O'Reilly & Associates and Mastering Java 2 and Borland's JBuilder: No Experience Required published by Sybex.
Caractéristiques techniques
PAPIER | |
Éditeur(s) | Springer |
Auteur(s) | John Zukowski |
Parution | 10/09/1999 |
Nb. de pages | 860 |
Format | 19 x 23,5 |
Poids | 1450g |
EAN13 | 9781893115026 |
Avantages Eyrolles.com
Consultez aussi
- Les meilleures ventes en Graphisme & Photo
- Les meilleures ventes en Informatique
- Les meilleures ventes en Construction
- Les meilleures ventes en Entreprise & Droit
- Les meilleures ventes en Sciences
- Les meilleures ventes en Littérature
- Les meilleures ventes en Arts & Loisirs
- Les meilleures ventes en Vie pratique
- Les meilleures ventes en Voyage et Tourisme
- Les meilleures ventes en BD et Jeunesse