The JavaTM Foundation Classes (JFC) Project
Swing and Enterprise JavaBeansTM
architectures share one key design element: the separation of data from
the display or manipulation of that data.
In Enterprise JavaBeans applications, the entity bean provides a view
of the data. The underlying data storage mechanism can be swapped out and
replaced without changing the entity bean view or recompiling any code
that uses the view.
Project Swing separates the view and control of a visual component from
its contents, or data model. However, although Project Swing does have
the components that make up a Model-View-Controller (MVC) architecture,
it is more accurately described as a model-delegate architecture. This is
because the controller part of the Project Swing interface, often the
mouse and keyboard events the component responds to, is combined with the
physical view in one User Interface delegate (UI delegate) object.
Each component, for example a JButton
or a JScrollBar
,
has a separate UI delegate class that inherits from the ComponentUI
class and is under the control of a separate UI manager. While each component
has a basic UI delegate, it is no longer tied to the underlying data so a new
set of delegets -- a set of metal-styled components, for example --
can be swapped in while the application is still running. The ability
to change the look and behavior reflects the pluggable look and feel (PLAF)
feature available in Project Swing.
This chapter describes Project Swing user interface components in terms
of the AuctionClient
example application.
In a Rush?
This table links you directly to specific topics.
Topic |
Section |
Components and Data Models |
|