December 1999
Intermediate to advanced
816 pages
20h 27m
English
As explained in Chapter 6, "Interfaces," a class that is declared as implementing an interface must implement all the methods declared by that interface. For an ActionListener, this is pretty simple, because the ActionListener interface defines only one method:
public void actionPerformed(ActionEvent e)
For other interfaces, however, that's not the case. For example, every GUI application should have a WindowListener. The WindowListener interface has several methods declared in it, most of which are not necessary for most programs. In order to implement this interface, you might have to create an event-listener class that has several empty methods, like the one shown here:
public void windowClosed(WindowEvente)
{ }
In order ...
Read now
Unlock full access