home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Color;
-
- public class ColorThread extends Thread {
- ThreadApplet5 applet;
- int count;
-
- ColorThread(ThreadApplet5 var1) {
- this.applet = var1;
- }
-
- public void run() {
- while(true) {
- if (this.applet.color1 == Color.red) {
- this.applet.color1 = Color.blue;
- this.applet.color2 = Color.red;
- this.applet.color3 = Color.green;
- } else if (this.applet.color1 == Color.blue) {
- this.applet.color1 = Color.green;
- this.applet.color2 = Color.blue;
- this.applet.color3 = Color.red;
- } else {
- this.applet.color1 = Color.red;
- this.applet.color2 = Color.green;
- this.applet.color3 = Color.blue;
- }
-
- this.applet.repaint();
-
- try {
- Thread.sleep(100L);
- } catch (InterruptedException var1) {
- }
- }
- }
- }
-