home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / unuy2wen / cybcerone / main / nowupdatethread.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  621 b   |  34 lines

  1. // NowUpdateThread.java
  2. // 26.03.96
  3. //
  4. // The thread responsible for updating the NowPanel every minute, so it
  5. //  stays current
  6.  
  7. package cybcerone.main;
  8.  
  9. /**
  10.  * Spawned by the NowPanel so it can keep itself current.
  11.  */
  12. class NowUpdateThread extends Thread {
  13.   private final int delay = 60000;
  14.  
  15.   private NowPanel theNow;
  16.   
  17.   public NowUpdateThread (NowPanel theNow) {
  18.     this.theNow = theNow;
  19.   }
  20.  
  21.   public void run () {
  22.     while (true) {
  23.       
  24.       try {
  25.     sleep (delay);
  26.       } catch (InterruptedException e) {
  27.       }
  28.  
  29.       theNow.setTheEvents (theNow.findEvents ());
  30.       theNow.updatePanels ();
  31.     }
  32.   }
  33. }
  34.