📅  最后修改于: 2020-11-18 07:47:38             🧑  作者: Mango
Event类代表事件。 Java为我们提供了各种Event类,但我们将讨论更常用的类。
它是从其派生所有事件状态对象的根类。所有事件都是通过对对象source的引用构造的,该对象在逻辑上被认为是最初发生有关事件的对象。此类在java.util包中定义。
以下是java.util.EventObject类的声明:
public class EventObject
extends Object
implements Serializable
以下是java.util.EventObject类的字段:
受保护的对象源-事件最初发生在的对象。
S.N. | Constructor & Description |
---|---|
1 |
EventObject(Object source) Constructs a prototypical Event. |
S.N. | Method & Description |
---|---|
1 |
Object getSource() The object on which the Event initially occurred. |
2 |
StringtoString() Returns a String representation of this EventObject. |
此类从以下类继承方法:
java.lang.Object
以下是常用事件类的列表。
Sr. No. | Control & Description |
---|---|
1 |
It is the root event class for all AWT events. This class and its subclasses supercede the original java.awt.Event class. |
2 |
The ActionEvent is generated when button is clicked or the item of a list is double clicked. |
3 |
The InputEvent class is root event class for all component-level input events. |
4 |
On entering the character the Key event is generated. |
5 |
This event indicates a mouse action occurred in a component. |
6 |
The object of this class represents the text events. |
7 |
The object of this class represents the change in state of a window. |
8 |
The object of this class represents the adjustment event emitted by Adjustable objects. |
9 |
The object of this class represents the change in state of a window. |
10 |
The object of this class represents the change in state of a window. |
11 |
The object of this class represents the change in state of a window. |
12 |
The object of this class represents the change in state of a window. |