Introduction to the Java
Foundation Classes
Rev.
1.0
This 2-day module introduces the Java
programmer to the Java Foundation Classes – a.k.a. Swing – the new
comprehensive framework for GUI development using Java. The student will study
the fundamentals of the JFC architecture – including a review of key AWT
concepts, if necessary – and quickly move to building simple JFC frame-based
applications. The standard controls
are covered, including labels, text components, buttons, listboxes, and
comboboxes. (For coverage of tree
and table controls look to our module Advanced Data Structures and JFC.) Architectural patterns are emphasized, especially JFC’s
strict use of the Model-View-Controller paradigm.
Understanding the thorough use of this pattern in JFC is critical to
using the framework effectively. Event
handling is treated, both handling AWT-style events, such as action events from
button clicks, and handling events fired by the model that lies under a
particular control.
LEARNING OBJECTIVES
·
Understand the basics of the JFC
architecture.
·
Build simple GUI applications using JFC.
·
Build more complex GUIs using various
JFC controls.
·
Use the many hooks into the JFC
architecture to easily customize rendering and editing within JFC controls.
·
Understand the significance of the MVC
decomposition in using JFC controls.
·
Build GUI classes that make effective
use of events as fired from model, view and controller elements of the GUI
itself.
Course
Duration: 2
days.
Prerequisites:
·
Solid experience with Java programming
is required.
·
A firm understanding of OO concepts is
strongly recommended.
·
Knowledge of AWT is strongly
recommended, but some review is done and very little direct AWT coding is
involved in the module.
Within Object Innovations’ Java curriculum a good preparation for this module would be the first three modules of our Java Programming course, and possibly the fourth module module, which covers AWT.
1.
Introduction to JFC
Abstract Windowing Toolkit Basics
Simple Layout Management
Simple Event Handling
Lightweight Controls
JFC Feature Set
JFC Architecture and Relationship to AWT
2.
JFC Application Design
Role of a JFrame
Building a Frame-Based JFC Application
Panes
Using Dialogs
3.
JFC Components
JFC Component Class Hierarchy
JComponent Features
Simple Control Types
Text Components
Menus
Managing Look and Feel
4.
Architectural Patterns
Observer Pattern
Model-View-Controller Decomposition
Strategy Pattern
JList
Factory Pattern
JComboBox
Appendix
A. References
Appendix
B. JFC Event Sources – Quick Reference
System Requirements
JDK 1.2 and the JavaIDL compiler are
required. Any system that supports
both of these will support the lab software.
A TCP network between student machines is strongly recommended but not
critical.