An Adapter class is provided in java.awt.event package for those Listener interfaces which are having more than one method. Such as MouseAdapter, WindowAdapter, etc. Adapter class is derived from Listener interface and it provides blank definition of all the methods of derived listener. So that when we use Adapter class instead of Listener interface we can skip writing any of the method which are unused.


  1. Components/Event Sources can be easily accessed from Listener methods
  2. To apply an event we have to pass anonymous object of Adapter class
  3. Logic is to be written in complex inner methods
  4. Not compulsory to define all the methods. No need to write Blank definition if not required.


import java.awt.*;
import java.applet.*;
import java.awt.event.*;

public class EventDemo4 extends Applet
	Button btn;
	Label lbl;
	public void init()
		btn = new Button("Click Me!");
		lbl = new Label("          ");

		btn.addMouseListener(new MouseAdapter()
			public void mouseClicked(MouseEvent e)
<applet code="EventDemo4" width="500" height="50"></applet>