|
@ -24,14 +24,22 @@ public class TimerLable extends JLabel { |
|
|
|
|
|
|
|
|
public void reset() { |
|
|
public void reset() { |
|
|
task.reset = true; |
|
|
task.reset = true; |
|
|
|
|
|
counter = 0; |
|
|
|
|
|
setText(String.valueOf(counter)); |
|
|
|
|
|
repaint(); |
|
|
|
|
|
task.stop = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void stop() { |
|
|
|
|
|
task.stop = true; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Helper extends TimerTask |
|
|
class Helper extends TimerTask |
|
|
{ |
|
|
{ |
|
|
public boolean reset; |
|
|
public boolean reset; |
|
|
|
|
|
public boolean stop; |
|
|
public static int i = 0; |
|
|
public static int i = 0; |
|
|
private TimerLable timerLable; |
|
|
private TimerLable timerLable; |
|
|
|
|
|
|
|
@ -40,6 +48,9 @@ class Helper extends TimerTask |
|
|
} |
|
|
} |
|
|
public void run() |
|
|
public void run() |
|
|
{ |
|
|
{ |
|
|
|
|
|
if(stop) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
if(reset) { |
|
|
if(reset) { |
|
|
reset = false; |
|
|
reset = false; |
|
|
timerLable.counter = 0; |
|
|
timerLable.counter = 0; |
|
|