timerevent.java

来自「corejava的源程序内有好多的源代码」· Java 代码 · 共 39 行

JAVA
39
字号
/**
   @version 1.11 2001-08-21
   @author Cay Horstmann
*/

import java.util.*;

/**
   A class to describe timer events.
*/
public class TimerEvent extends EventObject
{ 
   /**
      Constructs a timer event.
      @param source the event source
   */
   public TimerEvent(Object source)
   {  
      super(source);
      now = new Date();
   }

   /**
      Reports when the event was constructed.
      @return the construction date and time
   */
   public Date getDate() 
   { 
      return now; 
   }

   public String toString() 
   { 
      return now + ":" + super.toString(); 
   }
   
   private Date now;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?