home *** CD-ROM | disk | FTP | other *** search
- public class MyThread2 extends Thread {
- ThreadApplet3 applet;
- boolean forward;
- int count;
- int increment;
- int end;
- int position;
-
- MyThread2(ThreadApplet3 var1, boolean var2) {
- this.applet = var1;
- this.forward = var2;
- }
-
- public void run() {
- this.InitCounter();
- this.DoCount();
- }
-
- protected void InitCounter() {
- if (this.forward) {
- this.count = 0;
- this.increment = 1;
- this.end = 1000;
- this.position = 120;
- } else {
- this.count = 1000;
- this.increment = -1;
- this.end = 0;
- this.position = 180;
- }
- }
-
- protected void DoCount() {
- while(this.count != this.end) {
- this.count += this.increment;
- String var1 = String.valueOf(this.count);
- this.applet.SetDisplayStr(var1, this.position);
-
- try {
- Thread.sleep(100L);
- } catch (InterruptedException var2) {
- }
- }
-
- }
- }
-