我想使用该方法javax.swing.Timer
创建一个从 3:00 开始,然后下降到 0:00 的计时器。我不知道如何使用这种方法以及如何进行。从现在开始,我有这个代码,但我不知道它是否好。可以肯定的一件事是它不起作用。
private javax.swing.Timer timer = new javax.swing.Timer(1000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
int minute = 3;
int seconde = 60;
do {
lblTimer.setText(Integer.toString(seconde));
seconde--;
} while (seconde != 0);
}
});