📅  最后修改于: 2020-11-18 07:47:55             🧑  作者: Mango
事件侦听器代表负责处理事件的接口。 Java为我们提供了各种事件侦听器类,但我们将讨论那些更常用的类。事件侦听器方法的每个方法都有一个参数作为对象,它是EventObject类的子类。例如,鼠标事件侦听器方法将接受MouseEvent的实例,其中MouseEvent源自EventObject。
它是每个侦听器接口都必须扩展的标记接口。此类在java.util包中定义。
以下是java.util.EventListener接口的声明:
public interface EventListener
以下是常用事件侦听器的列表。
Sr. No. | Control & Description |
---|---|
1 |
This interface is used for receiving the action events. |
2 |
This interface is used for receiving the component events. |
3 |
This interface is used for receiving the item events. |
4 |
This interface is used for receiving the key events. |
5 |
This interface is used for receiving the mouse events. |
6 |
This interface is used for receiving the text events. |
7 |
This interface is used for receiving the window events. |
8 |
This interface is used for receiving the adjusmtent events. |
9 |
This interface is used for receiving the container events. |
10 |
This interface is used for receiving the mouse motion events. |
11 |
This interface is used for receiving the focus events. |