
Be sure that the header of
the actionPerformed
method is coded correctly.
Otherwise,your method
will not override the
abstract actionPerformed
method,as required by the
ActionListener interface.
COMMON ERROR
TRAP
12.5 Text Fields 843
TABLE 12.10 ActionListener Method API
public void actionPerformed( ActionEvent event )
An event handler that implements the ActionListener interface writes code in this method to
respond to the ActionEvent fired by any registered components.
display a legal warning, we turn off the ability of the user to type into the
text area by calling the setEditable method with the argument false (line 45).
At lines 47–53, we add all the components ...