| C:\upload\java\Life\source\java\Pause.java |
/******************************************************************* The next class (note that word, "class."), < pause >, is a separate thread "sleeps" for a given time. Why do we have this class? If the user inputs a time delay, and requests the game to quit, this way we may quit immediately by stopping the thread, by stopping the tread. ******************************************************************** */ final public class Pause extends Thread { private int time; Pause(int time) { this.time = time; } public void run() { try { Thread.sleep(time); // Kill some time. } catch (InterruptedException e) { /* Do nothing. */ } } }