与事件发生有关的状态信息一般都封装在一个事件状态对象中,这种对象是java.util.EventObject的子类。按设计习惯,这种事件状态对象类的名应以Event结尾。例如: public class MouseMovedExampleEvent extends java.util.EventObject
{ protected int x, y; /* 创建一个鼠标移动事件MouseMovedExampleEvent */ MouseMovedExampleEvent(java.awt.Component source, Point location) { super(source); x = location.x; y = location.y; } /* 获取鼠标位置*/ public Point getLocation() { return new Point(x, y); }}