Chapter 9: Interfaces and Polymorphism
Career Services Seminar - What Can I Do With a CS Major?
Inner Classes
- An inner class is used as a helper class inside of an outer class.
- MyButton.java below demonstrates the use of an inner class,
ButtonActionListener, in an outer class, MyButton.
Event Handling
- Events can be generated by many activities such as key presses or
mouse moves.
- When an event occurs, the event source will notify the event handler.
- The functionality provided by the event handler can be customized
by implementing an interface.
- In the MyButton class below, can you identify the event source
and the event listener for the buttons?
Lecture Code