home *** CD-ROM | disk | FTP | other *** search
/ Java by Example / jbecd.bin / JBE-CD / NTUsers / JBECODE.ZIP / JavaByExample / chap31 / ColorThread2.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-03-21  |  757 b   |  25 lines

  1. import java.awt.Color;
  2.  
  3. public class ColorThread2 extends Thread {
  4.    ThreadApplet6 applet;
  5.    int count;
  6.  
  7.    ColorThread2(ThreadApplet6 var1) {
  8.       this.applet = var1;
  9.    }
  10.  
  11.    public void run() {
  12.       while(true) {
  13.          this.applet.color1 = Color.red;
  14.          this.applet.color2 = Color.green;
  15.          this.applet.color3 = Color.blue;
  16.          this.applet.repaint();
  17.  
  18.          try {
  19.             Thread.sleep(100L);
  20.          } catch (InterruptedException var1) {
  21.          }
  22.       }
  23.    }
  24. }
  25.