enableEvents 
   protected final void enableEvents(long eventsToEnable)   Enables the events defined by the specified event mask parameter to be delivered to this component. Event types are automatically enabled when a listener for that event type is added to the component. This method only needs to be invoked by subclasses of Component which desire to have the specified event types delivered to processEvent regardless of whether or not a listener is registered.    Parameters:eventsToEnable - the event mask defining the event types

解决方案 »

  1.   

    其中参数:
      WINDOW_EVENT_MASK 
      public static final long WINDOW_EVENT_MASK  The event mask for selecting window events.此外还有这个:
      ACTION_EVENT_MASK 
      public static final long ACTION_EVENT_MASK  The event mask for selecting action events
      

  2.   

    其实你要在你的类你还要实现一个接口方法processEvent(Event....)
    在调用的的方法enableEvents(...)就能想监听器一样,实现动作了!