我用了个定时器
如下:
Timer timer=new Timer(200,new ActionListener());
编译时  总是出错 ,能告诉我怎么改吗?

解决方案 »

  1.   

    很多中间件服务器,jdk中也有Timer,你用的是哪个?
      

  2.   

    我用的是 java.util 包中 的Timer
    jdk5.0中
    Timer timer=new Timer()这样编译通过不了
      

  3.   

    Constructor Summary 
    Timer() 
              Creates a new timer. 
    Timer(boolean isDaemon) 
              Creates a new timer whose associated thread may be specified to run as a daemon. 
    Timer(String name) 
              Creates a new timer whose associated thread has the specified name. 
    Timer(String name, boolean isDaemon) 
              Creates a new timer whose associated thread has the specified name, and may be specified to run as a daemon. 
    这是java.util.Timer类的所有构造函数。
      

  4.   

    import javax.swing.Timer;估计你要的是这个...