Java Reference
In-Depth Information
To Implement the Activator Interface
1. Start TextPad and open the file, LogonFrame.java, from the Chapter10
folder on the Data Disk. Replace lines 1 through 16 as shown in
Figure 10-49 on page 657. In the comments, insert your own name as
programmer and enter the current date.
TextPad displays code for the initial comments, class header, instance
variables, and constructor header for the LogonFrame class (Figure 10-50).
The LogonFrame class implements both the ActionListener and the Activator
interfaces.
LogonFrame.java
LogonFrame.java
replaced lines
implements multiple
interfaces
instance
variables
FIGURE 10-50
2.
Replace lines 160 through 174 as shown in Figure 10-49.
TextPad displays code for the method, doStockActivity(), and the callback
method, activate() (Figure 10-51). The keyword, this, is used to indicate
that a reference to the current object is passed to a new StockFrame object.
this reference passed to
new StockFrame object
hides LogonFrame window
displays StockFrame
window
replaced lines
callback method, activate()
makes LogonFrame visible
FIGURE 10-51
 
Search WWH ::




Custom Search