需要一个例子,如何在SwingWorker中使用计时器?因为无法像我那样将ActionListener添加到我的Timer中!
private Timer timer = new Timer(100, new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
}
});
Run Code Online (Sandbox Code Playgroud)
消息错误:构造函数Timer(int,new ActionListener(){})未定义