Listening For Events With the 1.0 Model
- So, how do we deal with the action event
posted by the button? Well, as we mentioned earlier, we can listen
for and handle button events in a couple of different ways.
- The first way is to use the JDK 1.0 model.
In the 1.0 model, when the OK button posts an event, the handleEvent()
method of the button object is called with an object that contains
information about the event. If the button doesn't handle the event,
the button's parent is notified. This continues up the
chain until the event reaches the top-most container.
- Thus, in order to capture and handle the event
at any stage we need to implement a handleEvent() method to catch the
event the button posts.
Previous Page |
Next Page
|