Next:
Course Information
Course Information
Aims and Objectives
Course Structure
Recommended Course Books
Other Online References
Introduction: Java Swing
The Dark Ages (Not So Long Ago)
What is Swing?
The Java Foundation Classes
Swing Features
The Swing Component Hierarchy
Swing Packages
The Model-View-Controller Architecture
The Basic MVC Model
MVC in Swing
First Swing programs
On from AWT
A simple AWT program
Now lets Swing
Adding Images to Our Buttons
Changes to The Event Handler
Swing Component Basics
Actions
Adding Actions to Containers
The Action Interface
Action Field Summary
Action Method Summary
The
AbstractAction
Class
AbstractAction
Field Summary
AbstractAction
Constructor Summary
AbstractAction
Method Summary
An
AbstractAction
Example
Sending Change Events in Swing
Labels and Icons
The
JLabel
Class
Label Mnemonics
Label Alignment
Images as Labels
Icons
The
Icon
Interface
Doing your own Icon
Swing Containers
The
JFrame
Class
JFrame
variables
JFrame
constructors
JFrame
(selected) methods
The
JInternalFrame
Class
The
JApplet
Class
JApplet
variables
JApplet
constructor
JApplet
(selected) methods
The
JPanel
Class
Simple border types
Practical Use of Borders
Swing layout managers
Tabbed Panes --
JTabbedPane
Creating a
JTabbedPane
Adding and inserting pages
Removing pages
Selecting pages
A complete
JTabbedPane
example
Scrolling panes
An example using
JScrollPane
Controlling the scroll bars
Controlling the scrolling in the application
Creating scrollable components
Split panes
Sample application with
JSplitPane
Intercepting
JSplitPane
events
Menus and Toolbars
What is a menu?
Using menus
Menu bars
Creating application menus
Menus
Organizing Menus on the MenuBar
Creating cascading menus
Menu items
A More Complete JMenu Example
Pop-up menus
When to use Pop-up menus?
Pop-up Example
Toolbars
Toolbar basics
Toolbar Example
Turning On/Off Docking
Dialogs
The Need for Dialogs
Using Dialogs
Swing Dialogs
Simple Dialogs --
JDialog
A simple dialog
Option dialogs --
JOptionPane
JOptionPane
constants
JOptionPane
constructors
JOptionPane
significant methods
An OptionPane Example
The File Chooser --
JFileChooser
A Sample FileChooser Program
The
JFileCooser
class explained
The colour chooser --
JColorChooser
Text In Swing
The
JTextComponent
-- Text Component Hierarchy
The
JTextComponent
Clipboard operations
Saving and loading
Other
JTextComponent
significant methods
Document handling
Document
significant methods
Text fields and Password fields
Associating Keyboard Mnemonics
Document Event Handling Example
The
JPasswordField
Text areas
Combo boxes --
JComboBox
Adding and removing list items
Selecting items
Allowing field editing
Other combo box features
Viewing HTML and other content types -- the
JEditorPane
The
JEditPaneExample
Program
Listening for hyperlink changes
Viewing RTF format
Simple document processing
Progress Bars, Scroll Bars and Sliders
Progress bars --
JProgressBar
Creating and using a Progress Bar
JProgressBar
variables
JProgressBar
methods
Scroll bars --
JScrollBar
ScrollBar Creation and Use
JScrollBar
variables
JScrollBar
constructors
JScrollBar
methods
Sliders --
JSlider
Listening for slider activity
JSlider
variables
JSlider
constructors
JSlider
methods
List --
JList
The
JList
Class
Practical List Design and Usage
A simple
JList
example
Dynamically Updating a List
Custom data model list items
Basic custom list rendering
JList
constructors
JList
important methods
Trees --
JTree
List v. Trees
Practical Usage of Tress in Interfaces
A basic JTree example
Adding new tree items
Custom data models
Custom rendering
Editing tree nodes
Listening for tree actions
Listening for tree selections
Listening for tree expansions
Practical Programming of
JTree
s
Hiding the root node
Expanding and collapsing the tree
Selecting and deselecting nodes
JTree
Class Information
Tables --
JTable
Graphical use of Tables
A Simple table Example
A More Complex
JTable
Example
Adding a Custom Data Model
Custom Table Rendering
Listening for Table Actions
Detecting Table Selections
Detecting Column Property Changes
JTable
Constants
JTable
Variables
JTable
Constructors
JTable
Methods
Finishing Off
Things Not Covered
About this document ...
Dave Marshall
4/14/1999