December 1999
Intermediate to advanced
816 pages
20h 27m
English
Let me illustrate interfaces through GUI event handling. An event is basically an action such as clicking a button, selecting a Menu item, or clicking on an item in a List box. The type of event that is generated when you click a Java button object with the mouse is an ActionEvent.
Think of all the Applets and applications written in Java that have an OK or Submit button or the like. No one class, even with hundreds of methods, could provide for all these buttons.
This problem is solved by using an interface for event handling. An interface declares the name of the method to call, but it leaves the implementation of OK-button logic completely open. It also provides for a common method name where ...
Read now
Unlock full access