1
這裏的代碼爲什麼計時器不會遞減?
public class TimeClass implements ActionListener{
int timerCounter;
public TimeClass(int timerCounter){
this.timerCounter = timerCounter;
}
public void ActionPerformed(ActionEvent time){
timerCounter--;
if(timerCounter >= 1){
timeLeft.setText("Time Remaining: " + timerCounter);
}else{
timer.stop();
timeLeft.setText("Game Over!");
click.setEnabled(false);
}
}
public void actionPerformed(ActionEvent e) {
}
}
定時器不decrement.what;錯的代碼,我需要爲我的presentation.need這個儘快。謝謝。
謝謝先生。該程序現在可以正常工作。 :) – 2013-03-24 11:48:15