September 2005
Beginner
576 pages
13h 6m
English
Before you can receive user input in a Java program, you must learn how to teach an object to listen. Responding to user events in a Java program requires the use of one or more EventListener interfaces. Interfaces are special classes that enable a class of objects to inherit behavior it would not be able to use otherwise.
Adding an EventListener interface requires two things right away. First, because the listening classes are part of the java.awt.event group of classes, you must make them available with the following statement:
import java.awt.event.*;
Second, the class must use the implements statement to declare that it supports one or more listening interfaces. The following statement creates a class that ...
Read now
Unlock full access