Graphic Java 2, Volume 2, Swing / Edition 3

Graphic Java 2, Volume 2, Swing / Edition 3

by David Geary
     
 

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

See more details below

Overview

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.

Read More

Product Details

ISBN-13:
9780130796677
Publisher:
Prentice Hall
Publication date:
03/12/1999
Series:
Sun Microsystems Press Series
Edition description:
3RD BK&CDR
Pages:
1600
Product dimensions:
7.00(w) x 8.90(h) x 3.50(d)

Meet the Author

David Gearywas lead engineer for the user interface toolkit for JavaSoft's Java Management API. He has been developing GUIs and using object-oriented technology since 1984, including C++, Smalltalk, Eiffel, Objective-C and now Java. He is currently an independent Java consultant.

Table of Contents

Audience.

How to Use This Book.

Component Summaries.

Properties.

Swing Bugs.

Using the CD-ROM.

Swing and the JDK.

Code Examples from the Book.

Applets vs. Applications.

Conventions Used in This Book.

Acknowledgments.

I. SWING FUNDAMENTALS.

1. Introduction.

Swing History. Lightweight vs. Heavyweight Components. Swing Components. AWT Replacement Components. Additional Swing Components. J Components. Pluggable Look and Feel. An Overview of the Swing Packages. Swing and the AWT. Peers vs. Pluggable Look and Feel. Getting Started. Using Swing with Internet Browsers. Swing Resources. Parting Shots.

2. Swing Basics.

Applets and Applications. Applets. The JApplet Class. Applications. The JFrame Class. Applet/Application Combinations. GJApp. Mixing Swing and AWT Components. Zorder. Swing Popup Menus. Scrolling. Internal Frames. Swing and Threads. Ramifications of Swing’s Single-Threaded Design. SwingUtilities invokeLater and invokeAndWait Methods. Parting Shots.

3. Swing Component Architecture.

Classic Model-View-Controller Architecture. Pluggable Views and Controllers. View Updates. Swing MVC. Swing Components. A Static Perspective. A Dynamic Perspective. Models. UI Delegates. Component UI Scenarios. Listeners. Parting Shots.

4. The JComponent Class.

An Overview of the JComponent Class. Borders. Accessibility Support. Double Buffering. Debug Graphics. AutoScrolling. Tooltips. Keystroke Handling and Client Properties. The JComponent Class. Swing Components are AWT Containers. Minimum, Maximum, and Preferred Sizes. Rendering JComponents. Custom Painting in Swing Components. Overriding Paint Methods in AWT Components. Overriding Paint Methods in Swing Components. Paint, Repaint, and Update Methods. Validate, Invalidate, and Revalidate Methods. Opaque vs. Transparent Components. Immediate Painting of Swing Components. Double Buffering. Double Buffering in Custom Components. Debug Graphics. Autoscrolling. Autoscrolling in Custom Components. Tooltips. Tooltips Based on Mouse Position. Preferred Locations for Tooltips. Customizing Tooltip Behavior. Customizing Tooltip Look and Feel. Keystroke Handling. Client Properties. Focus Management. Accessibility. Parting Shots.

5. Borders, Icons, and Actions.

Borders. Borders and Insets. Swing Border Types. Opaque vs. Transparent Borders. The Border Package. The Border Interface. The AbstractBorder Class. The Border Factory — Sharing Borders. Replacing Built- in Borders. Implementing Custom Borders. Icons. Associating an Icon with a Component. Sharing Icons Among Components. Image Icons. Animated Image Icons. Actions. Actions as a Central Point of Control. Action Constants. Parting Shots.

6. Utilities.

Timers. The Timer Class. Event Listener Lists. The EventListenerList Class. Swing Utilities. Swing Constants. BoxLayout and the Box Class. BoxLayout. The Box Class. Progress Monitoring. ProgressMonitor. ProgressMonitorInputStream. Undo/Redo. A Simple Undo/Redo Example. UndoableEditSupport. Compound Edits. Undo Manager. State Edits. Parting Shots.

7. Pluggable Look and Feel.

Look-and-Feel Architecture. Look and Feels. Look-and-Feel Defaults. UI Manager. UI Resources. The Java Look and Feel. Client Properties. Themes. Auxiliary UIs. Parting Shots.

II. SWING COMPONENTS.

8. Labels and Buttons.

JLabel and JButton. JLabel. JLabel Properties. JLabel Events. JLabel Class Summaries. Buttons. Button Class Hierarchy. JButton. JButton Properties. JButton Events. JButton Class Summaries. AWT Compatibility. Parting Shots.

9. Toggle Buttons, Check Boxes, and Radio Buttons.

JToggleButtons. JToggleButton Properties. JToggleButton Events. JToggleButton Class Summaries. AWT Compatibility. Button Groups. Check Boxes. JCheckBox Properties. JCheckBox Events. JCheckBox Class Summaries. Radio Buttons. JRadioButton Properties. JRadioButton Events. JRadioButton Class Summaries. AWT Compatibility. Parting Shots.

10. Menus and Toolbars.

Menus, Menu Bars, and Toolbars. Menus and Popup Menus. JMenuItem. Menu Item Accelerators and Mnemonics. JMenuItem Properties. JMenuItem Events. JMenuItem Class Summaries. AWT Compatibility. JCheckBoxMenuItem. JCheckBoxMenuItem Properties. JCheckBoxMenuItem Events. JCheckBoxMenuItem Class Summaries. AWT Compatibility. JRadioButtonMenuItem. JRadioButtonMenuItem Properties. JRadioButtonMenuItem Events. JRadioButtonMenuItem Class Summaries. AWT Compatibility. JMenu. Dynamically Modifying Menus. Pull-right Menus. JMenu Properties. JMenu Events. JMenu Class Summaries. AWT Compatibility. Menu Elements. Implementing the MenuElement Interface. JPopupMenu. Popup Trigger. Light/Medium/HeavyWeight Popup Menus. Popup Menu Invokers. JPopupMenu Properties. JPopupMenu Events. JPopupMenu Class Summaries. AWT Compatibility. JMenuBar. Menu Bar Menus and Components. JMenuBar Properties. JMenuBar Events. JMenuBar Class Summaries. AWT Compatibilities. JToolBar. Rollover Toolbars. Using Actions with Toolbars. Floating Toolbars. Toolbar Buttons with Fixed- Location Tooltips. JToolBar Properties. JToolBar Events. JToolBar Class Summaries. AWT Compatibility. Parting Shots.

11. Progress Bars, Sliders, and Separators.

JProgressBar. Progress Bars and Threads. JProgressBar Properties. JProgressBar Events. JProgressBar Class Summaries. AWT Compatibility. JSlider. Filled Sliders. Slider Tick Marks. Slider Labels. Inverting Slider Values. Slider Extent. JSlider Properties. JSlider Events. JSlider Class Summaries. AWT Compatibility. JSeparator. Separators and Boxes. JSeparator Properties. JSeparator Events. AWT Compatibility. Parting Shots.

12. Lightweight Containers.

JPanel. JPanel Properties. JPanel Events. JPanel Class Summaries. AWT Compatibility. JRootPane. The RootPaneContainer Interface. Glass Panes. Content Panes. JRootPane Properties. JRootPane Events. JRootPane Class Summaries. AWT Compatibility. JLayeredPane. Zorder for Lightweight Components Revisited. Assigning Layers to Components. Positioning Components in the Same Layers. Using the Drag Layer. JLayeredPane Properties. JLayeredPane Class Summaries. AWT Compatibility. JTabbedPane. Tab Placement. JTabbedPane Properties. JTabbedPane Events. JTabbedPane Class Summaries. JSPlitPane. JSplitPane Properties. JSplitPane Events. JSplitPane Class Summaries. AWT Compatibility. Parting Shots.

13. Scrolling.

JViewport. Dragging a Viewport’s View. Using the scrollRectToVisibile Method. JViewport Properties. JViewport Events. JViewport Class Summaries. AWT Compatibility. JScrollPane. Scrollpane Headers. Scrollpane Corners. JScrollPane Properties. JScrollPane Events. JScrollPane Class Summaries. AWT Compatibility. The Scrollable Interface. JScrollBar. Manual Scrolling with Swing’s JScrollBar Class. Block and Unit Increments. JScrollBar Properties. JScrollBar Events. JScrollBar Class Summaries. AWT Compatibility. Parting Shots.

14. Windows and Dialogs.

JWindow. JWindow Properties. JWindow Class Summaries. AWT Compatibility. JDialog. JDialog Properties. JDialog Class Summaries. AWT Compatibility. JOptionPane. Internal Frames. Creating Dialogs with JOptionPane Static Methods. Message Dialogs. Confirmation Dialogs. Input Dialogs. Option Dialogs. JOptionPane Properties. JOptionPane Events. JOptionPane Class Summaries. AWT Compatibility. Parting Shots.

15. Internal Frames and Desktop Panes.

JInternalFrame. JInternalFrame Properties. JInternalFrame Events. AWT Compatibility. JDesktopPane. JDesktopPane Properties. JDesktopPane Events. JDesktopPane Class Summaries. AWT Compatibility. DesktopManager. DesktopManager Class Summaries. Parting Shots.

16. Choosers

JFileChooser. File Chooser Types. Accessory Components. Filtering File Types. File Views. Multiple Selection. JFileChooser Properties. JFileChooser Events. JFileChooser Class Summaries. AWT Compatibility. JColorChooser. Displaying Color Choosers in Dialogs. Customizing Color Choosers. JColorChooser Properties. JColorChooser Events. JColorChooser Class Summaries. AWT Compatibility. Parting Shots.

17. Lists.

List Models. AbstractListModel. DefaultListModel. List Selections. List Cell Renderers. JList Properties. JList Events. JList Class Summaries. AWT Compatibility. Parting Shots.

18. Combo Boxes.

JComboBox vs. JList. The JComboBox Component. Combo Box Models. ComboBoxModel. MutableComboBoxModel. DefaultComboBoxModel. Combo Box Cell Renderers. Combo Box Key Selection Managers. Using the Default Key Selection Managers. Custom Key Selection Managers. Programmatic Key Selection. Combo Box Editors. JComboBox Properties. JComboBox Events. JComboBox Class Summaries. AWT Compatibility. Parting Shots.

19. Tables.

Tables and Scrolling. Block and Unit Increments. Table Models. Table Data Models. The TableModel Interface. AbstractTableModel. DefaultTableModel. Table Models and Default Renderers and Editors. Table Columns. Column Resize Modes. Column Widths. Table Column Models. The DefaultTableColumnModel Class. Column Margins. Hiding Columns. Locking the Left-Hand Column. Table Selection. Rendering and Editing. Using Table Cell Renderers and Editors. Table Cell Rendering. Cell Editors. Table Cell Editors. Implementing the TableCellEditor Interface. Table Rows. Row Height. Rendering by Rows. Table Decorators. Sorting Decorators. Table Headers. JTableHeader. Column Header Renderers and Header ToolTips. JTable Properties. Table Events. Table Model Events. TableColumnModel Events. List Selection Events. JTable Class Summaries. AWT Compatibility. Parting Shots.

20. Trees.

Creating Trees. Tree Nodes. The TreeNode Interface. The MutableTreeNode Interface. The DefaultMutableTreeNode Class. Tree Paths. Tree Models. Default TreeModel. Tree Selection. DefaultTreeSelectionModel. Tree Cell Rendering. DefaultTreeCellRenderer. Metal Look and Feel. Root Nodes and Root Handles. Tree Cell Editing. Extending DefaultCellEditor. DefaultTreeCellEditor. Rendering and Editing: A Case Study. The Test Class. The SelectableFile and FileNode Classes. The Renderers. The Editors. JTree Properties. Tree Events. JTree Class Summaries. AWT Compatibility. Parting Shots.

21. Text Fundamentals.

Swing Text Components. The Swing Text Package. Actions. Text Actions. Actions and Editor Kits. Keymaps. Documents. Custom Documents. Document Listeners. Carets and Highlighters. Carets. Caret Listeners. Custom Carets. Highlighters. Undo/Redo. JTextComponent. JTextComponent Properties. Parting Shots.

22. Text Components.

JTextField. Horizontal Visibility and Scroll Offset. Laying Out Text Fields. Validating Text Fields. JTextField Component Summary. JTextField Properties. JTextField Events. JTextField Class Summaries. AWT Compatibility. JPassword Field. JPasswordField Component Summary. JPasswordField Properties. JPasswordField Class Summary. JTextArea. JTextArea Component Summary. JTextArea Properties. JTextArea Class Summaries. AWT Compatibility. JEditorPane. JEditorPane Properties. JEditorPane Events. JEditorPane Class Summaries. JTtextPane. Embedding Icons and Components. Marking Content with Attributes. JTextPane Properties. JTextPane Class Summaries. AWT Compatibility. Parting Shots.

23. Customizing Text Components.

Overview. Attribute Sets and Style Constants. Custom Actions. Views. Implementing Custom Views. Styles and Style Contexts. Elements. Parting Shots.

Appendix A.

Class Diagrams. Class Diagram Legend. An Example Class Diagram.

Appendix B.

Pluggable Look & Feel Constants.

Index.

Read More

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >