Java Reference
In-Depth Information
Figure 3.3 The counter application
ActionListener
JFrame
JPanel
JLabel
JButton
SimpleFrame
CounterPanel
CounterListener
showIt()
increment()
decrement()
actionPerformed(evt)
CounterFrame
Counter
increment()
decrement()
reset()
getValue()
CounterDriver
main()
Legend:
is derived from
uses
A
A
B
A
B
B
A
B
Figure 3.4 The class diagram for the
its.CounterGUI
package. The test class
Coun-
terTest
has been omitted
■
3.5
Summary
In order to develop an interactive GUI the following steps are necessary:
1. Implement and test the model.
2. Implement the view, especially:
(a) Decide which graphical components to use.
(b) Decide how to arrange them.
(c) Decide which layout manager(s) to use.
Search WWH ::
Custom Search