Book description
The Swing classes eliminate Java's biggest weakness: its relatively primitive user interface toolkit. Swing provides many new components and containers that allow you to build sophisticated user interfaces, far beyond what was possible with AWT. The old components have been greatly improved, and there are many new components, like trees, tables, and even text editors. It also adds several completely new features to Java's user interface capabilities: drag-and-drop, undo, and the ability to develop your own "look and feel," or the ability to choose between several standard looks. The Swing components are all "lightweight," and therefore provide more uniform behavior across platforms, making it easier to test your software. All these new features mean that there's a lot to learn. Swing is undoubtedly way ahead of AWT -- or, for that matter, any widely available user interface toolkit -- but it's also a lot more complicated. It's still easy to do simple things. But once you've seen what's possible, you won't want to do the simple things. Java Swing gives you in-depth coverage of everything you need to know to take full advantage of Swing, providing detailed descriptions of every class and interface in the key Swing packages. It shows you how to use all of the new components, allowing you to build state-of-the-art user interfaces. It also discusses how the components implement the MVC (Model View Controller) architecture, so you can understand how the components are designed and subclass them intelligently. Finally, it shows how to create your own "look and feel." Throughout, Java Swing focuses on giving you the context you need to understand what you're doing. It's more than documentation; Java Swing helps you develop code quickly and effectively. Whether you're a serious Java developer, or just trying to find out what Java can do, you'll find Java Swing an indispensable guide.
Table of contents
-
Java Swing
- Preface
- 1. Introducing Swing
- 2. Jump Starting a Swing Application
- 3. Swing Component Basics
- 4. Labels and Icons
- 5. Buttons
- 6. Bounded Range Components
- 7. Lists and Combo Boxes
- 8. Swing Containers
- 9. Internal Frames
-
10. Swing Dialogs
- The JDialog Class
-
The JOptionPane Class
- Properties
- JOptionPane Structure
- Using JOptionPane
- Events
- Constants
- Protected Fields
- Four Dialog Types
- Constructors
- Static Dialog Display Methods
- Dialog Creation Method Parameters
- Simple Examples
- Getting the Results
- A Comparison: Constructors vs. Static Methods
- Non-Static Methods
- Miscellaneous Static Methods
- Using Internal Frame Dialogs with JDesktopPane
-
11. Specialty Panes and Layout Managers
- The JSplitPane Class
- The JScrollPane Class
- The JTabbedPane Class
- Layout Managers
- Other Panes
-
12. Chooser Dialogs
- The JFileChooser Class
- The File Chooser Package
- The Color Chooser
- The JColorChooser Class
- 13. Borders
- 14. Menus and Toolbars
-
15. Tables
- Table Columns
- Table Data
- The JTable Class
- Editing and Rendering
- Selecting Table Entries
- 16. Advanced Table Examples
-
17. Trees
- A Simple Tree
- Tree Models
- Tree Nodes and Paths
- The JTree Class
- Tree Selections
- Tree Events
- Rendering and Editing
- What Next?
-
18. Undo
-
The Swing Undo Facility
- The UndoableEdit Interface
- The AbstractUndoableEdit Class
- The CompoundEdit Class
- The UndoableEditEvent Class
- The UndoableEditListener Interface
- The UndoManager Class
- The StateEditable Interface
- The StateEdit Class
- The UndoableEditSupport Class
- The CannotRedoException Class
- The CannotUndoException Class
- Extending UndoManager
-
The Swing Undo Facility
- 19. Text 101
-
20. Document Model and Events
-
The Document Model
- The Document Interface
- The Element Interface
- The ElementIterator Class
- The AttributeSet Interface
- The MutableAttributeSet Interface
- The SimpleAttributeSet Class
- The Position Interface
- The Position.Bias Class
- The Segment Class
- The AbstractDocument Class
- The AbstractDocument.AbstractElement Class
- The AbstractDocument.LeafElement Class
- The AbstractDocument.BranchElement Class
- The AbstractDocument.Content Interface
- The StringContent Class
- The GapContent Class
- The AbstractDocument.AttributeContext Interface
- The BadLocationException Class
- Model Summary So Far
- The PlainDocument Class
- Document Events
- Advanced AbstractDocument Event Model
-
The Document Model
-
21. Styled Documents and JTextPane
-
Style
- The Style Interface
- The StyleConstants Class
- The TabStop Class
- The TabSet Class
- The StyleContext Class
- The StyledContext.NamedStyle Class
- The StyledDocument Interface
- The DefaultStyledDocument Class
- The DefaultStyledDocument.SectionElement Class
- The DefaultStyledDocument.ElementSpec Class
- The DefaultStyledDocument.ElementBuffer Class
- The JTextPane Class
- A Stylized Editor
-
Style
-
22. Carets, Highlighters, and Keymaps
- JTextComponent UI Properties
-
23. Text Views
- Text Views
-
The View Classes
- The View Class
- The ViewFactory Interface
- The TabExpander Interface
- The TabableView Interface
- The Utilities Class
- The PlainView Class
- The FieldView Class
- The PasswordView Class
- The LabelView Class
- The ComponentView Class
- The IconView Class
- The CompositeView Class
- The BoxView Class
- The ParagraphView Class
- The WrappedPlainView Class
- The TableView Class
- The TableView.TableRow Class
- The TableView.TableCell Class
-
24. EditorKits and TextActions
-
Overview of the Editor Kits
- The EditorKit Class
- The TextAction Class
- The DefaultEditorKit Class
- The DefaultEditorKit.DefaultKeyTypedAction Class
- The DefaultEditorKit.BeepAction Class
- The DefaultEditorKit.CopyAction Class
- The DefaultEditorKit.CutAction Class
- The DefaultEditorKit.InsertBreakAction Class
- The DefaultEditorKit.InsertContentAction Class
- The DefaultEditorKit.InsertTabAction Class
- The DefaultEditorKit.PasteAction Class
- A Simple Text Editor
- The StyledEditorKit Class
- The StyledEditorKit.StyledTextAction Class
- The StyledEditorKit.FontFamilyAction Class
- The StyledEditorKit.FontSizeAction Class
- The StyledEditorKit.ForegroundAction Class
- The StyledEditorKit.AlignmentAction Class
- The StyledEditorKit.BoldAction Class
- The StyledEditorKit.ItalicAction Class
- The StyledEditorKit.UnderlineAction Class
- A Better Editor
- The HTML Package
- Much, Much More
- RTFEditorKit
- The AbstractWriter Class
- Building Your Own EditorKit
- Phew!
-
Overview of the Editor Kits
-
25. Programming with Accessibility
- How Accessibility Works
- The Accessibility Package
- Other Accessible Objects
- The Six Types of Accessibility
- The Accessibility Utility Classes
- Interfacing with Accessibility
-
26. Look & Feel
- How Does It Work?
- Key L&F Classes and Interfaces
- The MultiLookAndFeel
- Look-and-Feel Customization
- Creation of a Custom L&F
- 27. Swing Utilities
-
28. Swing Under the Hood
- Creating Your Own Component
- Working with Focus
- Lightweight vs. Heavyweight Components
- Multithreading Issues with Swing
- Painting and Repainting
- A. Look & Feel Resources
- Index
- Colophon
Product information
- Title: Java Swing
- Author(s):
- Release date: September 1998
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781565924550
You might also like
book
Java AWT Reference
The Java AWT Reference provides complete reference documentation on the Abstract Window Toolkit (AWT), a large …
book
Java Cookbook
The Java Cookbook is a comprehensive collection of problems, solutions, and practical examples for anyone programming …
book
Java Swing, 2nd Edition
Swing is a fully-featured user interface development kit for Java applications. Building on the foundations of …
book
Beginning Java 8 APIs, Extensions and Libraries Swing, JavaFX, JavaScript, JDBC and Network Programming APIs
completes the Apress learning Java journey and is a comprehensive approach to learning the Java programming …