public class TimerThreading implements Runnable{
private Thread timerThread;
private long pause = 0;
private boolean timesUp = false;
public TimerThreading(String threadName, long pauseLength){
timerThread = new Thread(this, threadName);
pause = pauseLength;
System.out.println(timerThread.getName());
timerThread.start();
}
public void run() {
try{
timerThread.sleep(pause);
timesUp = true;
}catch(InterruptedException e){timesUp = false;}
}
public boolean goodToGo(){return timesUp;}
}
Here's the code I have calling it inside of a display method in a different class:
if(tTimer.goodToGo()){
System.out.print "Timer rings!";
}
it's just not working...I'm perdy clueless so if anyones got a good link or some pointers it'd be appreciated!