home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / OS2 / NETREXX.ARJ / NETREXX.ZIP / NetRexx / NervousTexxt.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-06-25  |  1.8 KB  |  76 lines

  1. import java.applet.Applet;
  2. import java.awt.Component;
  3. import java.awt.Event;
  4. import java.awt.Font;
  5. import java.awt.Graphics;
  6.  
  7. public class NervousTexxt extends Applet implements Runnable {
  8.    protected char[] separated;
  9.    // $FF: renamed from: s java.lang.String
  10.    protected String field_0;
  11.    protected Thread killme;
  12.    protected boolean threadSuspended = false;
  13.    // $FF: renamed from: $0 java.lang.String
  14.    private static final String field_1 = "NervousTexxt.nrx";
  15.  
  16.    public void init() {
  17.       ((Applet)this).resize(300, 50);
  18.       ((Component)this).setFont(new Font("TimesRoman", 1, 30));
  19.       this.field_0 = ((Applet)this).getParameter("text");
  20.       if (this.field_0 == null) {
  21.          this.field_0 = "NetRexx";
  22.       }
  23.  
  24.       this.separated = new char[this.field_0.length()];
  25.       this.field_0.getChars(0, this.field_0.length(), this.separated, 0);
  26.    }
  27.  
  28.    public void start() {
  29.       if (this.killme == null) {
  30.          this.killme = new Thread(this);
  31.          this.killme.start();
  32.       }
  33.    }
  34.  
  35.    public void stop() {
  36.       this.killme = null;
  37.    }
  38.  
  39.    public void run() {
  40.       try {
  41.          while(this.killme != null) {
  42.             Thread.sleep(100L);
  43.             ((Component)this).repaint();
  44.          }
  45.       } catch (InterruptedException var1) {
  46.       }
  47.  
  48.       this.killme = null;
  49.    }
  50.  
  51.    public void paint(Graphics var1) {
  52.       boolean var2 = false;
  53.       int var3 = 0;
  54.       int var4 = 0;
  55.       int var5 = this.field_0.length() - 1;
  56.  
  57.       for(int var6 = 0; var6 <= var5; ++var6) {
  58.          var3 = (int)(Math.random() * (double)10.0F + (double)(15 * var6));
  59.          var4 = (int)(Math.random() * (double)10.0F + (double)36.0F);
  60.          var1.drawChars(this.separated, var6, 1, var3, var4);
  61.       }
  62.  
  63.    }
  64.  
  65.    public boolean mouseDown(Event var1, int var2, int var3) {
  66.       if (this.threadSuspended) {
  67.          this.killme.resume();
  68.       } else {
  69.          this.killme.suspend();
  70.       }
  71.  
  72.       this.threadSuspended = !this.threadSuspended;
  73.       return true;
  74.    }
  75. }
  76.