Java Reference
In-Depth Information
CHAPTER 8
■ ■ ■
The Graphical User Interfaces
I n the preceding chapters, the implementation of the data and network tiers for the Denny's
DVD application were discussed in detail. Now it is time to deal with the final development
tier: the graphical user interface (GUI).
In this chapter we will cover the following topics:
Designing simple yet usable GUIs
Reviewing Swing components and the event model
Implementing a JTable
Implementing the Model-View-Controller (MVC) design pattern
Implementing the Observer design pattern
It is not necessary to have read the networking chapters prior to reading this chapter. The
majority of this chapter details how to design your GUI, and as such, the networking sections
are not required. The sections of this chapter that deal with connecting to the database use the
Factory design pattern, which will provide an instance of a class that implements our connec-
tion interface. Naturally, though, you will not be able to connect the GUI to the database using
the networking options described in this chapter until after you have completed the network-
ing chapters.
Tip The way we are using the connection interfaces shows one of the benefits of using an interface: the
interface provides a contract that we can assume will be implemented—we don't need the actual imple-
mentation to develop our factory and use it.
While developing the Sun assignment, you might choose to start development of the GUI
prior to developing the networking classes. This is also a reasonable approach, and might even
be the preferred approach in real life—developing the GUI before the networking code means
that the customer could start working with the stand-alone application before the final code is
written.
225
Search WWH ::




Custom Search