title: Is there a way to have a void always running in java
body: <p>i'm trying to make a stat system for my game however i cant figure out how to make the stats go down over a certain period of time I've got the code to do so but i just need it to be always running so that my J frame can update and display the changed stat.</p>
  
  <pre><code>package pandacare;
  import java.util.Random;
  public class PandaCare {
  
  Random r = new Random();
  
  int HWT;
  
  int hunger = 0;
  int fun = 0;
  int thirst = 0;
  int energy = 0;
  int hygiene = 0;
  int points = 0;
  int coins = 1000;
  int total = hunger + fun +thirst + energy + hygiene;
  
  public void hungerWait(){
      int Low = 5;
      int High = 30;
      HWT = r.nextInt(High-Low) + Low;
  }
  
  public void hungerDown(){
      try {
          Thread.sleep(HWT);
      }           
      catch(InterruptedException ex) {
          Thread.currentThread().interrupt();
      }
      hunger --;
  }
  
  
  
  }
  </code></pre>