In AWT components, we came to know every component generates events when interacted by the user like clicking over a button or pressing enter key, etc. Listeners handle the events. the event handling involves four types of classes.
The event source is components, subclasses of AWT components, capable to generate events. The event source can be a button, TextField or a Frame, etc.
Almost every event source generates an event and is named by some java class. For example, the button generate Action Event and the checkbox generates ItemEvent. ALL events listed in java.awt.event package.
The event generated by GUI components is handled by a special group of the class known as “listeners”.Listner is an interface. Every component has its Own listeners say, AdjustmentListner handles the events of the scrollbar.
When a listner includes many abstract methods to override, the coding becomes heavy to the programmer. for example, to close the frame, you override seven abstract methods of WindowListener, in which in fact you are using only one method.to avoid this heavy coding, the designers come with another group of classes known as “adapters”.