关于Timer的问题(里面有源码)
import java.awt.event.*;import javax.swing.*;
class Timertest {
public Timertest(){
mytimeListener listener=new mytimeListener();
Timer nowtime=new Timer(1000,listener);
nowtime.start();
}
public class mytimeListener implements ActionListener{
public void actionPerformed(ActionEvent e){ // 运行到这里就停了,提示因为没实现
//actionPerformed 方法,可是已经实现了啊,谁能帮忙解决一下,谢谢了!
int i=0;
i++;
System.out.println(i);
}
}
public static void main(String args[]){
new Timertest();
}
}