In this section, you will learn how to handle events in Java
awt. Events are the integral part of the java platform. You can
see the concepts related to the event handling through the
example and use methods through which you can implement the
event driven application. For any event to occur, the objects
registers themselves as listeners. No event takes place if there
is no listener i.e. nothing happens when an event takes place if
there is no listener. No matter how many listeners there are,
each and every listener is capable of processing an event. For
example, a SimpleButtonEvent applet registers itself as the
listener for the button's action events that creates a Button
instance. ActionListener can be implemented by any Class
including Applet. One point to remember here is that all the
listeners are always notified. Moreover, you can also call
AWTEvent.consume() method whenever you don't want an event to be
processed further. There is another method which is used by a
listener to check for the consumption