home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1998 August / Software of the Month Club 1998 August.iso / mac / Business / Wallaby / Java / ScrollingText / ScrollText.java < prev   
Encoding:
Java Source  |  1998-06-03  |  1.7 KB  |  79 lines  |  [TEXT/CWIE]

  1. /*
  2.     Scrolling Text JAVA Applet
  3.     =====================
  4.     
  5.     ⌐ 1997 by Christoph Schaffhauser
  6.     cschaffhauser@datacomm.ch
  7.     http://www.datacomm.ch/darkeagl/
  8.  
  9.     The only conditions are that you do not alter it, manipulate or deconstruct it and
  10.     if you want to use this applet in you homepage, you have to make a link from your homepage
  11.     to my homepage:   http://www.datacomm.ch/darkeagl/
  12.     
  13.     Thanks Chris
  14.     
  15.     B.T.W: I'm addicted to emails.... If you have some time write me a small note :-)
  16. */
  17.  
  18. import java.util.*;
  19. import java.awt.*;
  20. import java.applet.*;
  21. import java.awt.Font;
  22. import java.awt.Graphics;
  23.  
  24. public class ScrollText extends Applet  implements Runnable {
  25.     Thread killme = null;
  26.     
  27.     Color white        = new Color(255,255,255);
  28.     Color gray        = new Color(166,166,166);
  29.     Color lightgray        = new Color(240,240,240);
  30.     Color darkgray        = new Color(207,207,207);
  31.     Color middlegray    = new Color(222,222,222);
  32.     Color darkgreen    = new Color(  10,43,  10);
  33.     Color black        = new Color(  0,0, 0);
  34.     Color yellow        = new Color(  255,255, 0);
  35.     Color green        = new Color(  0,255, 0);
  36.     Color orange        = new Color(  255,128, 0);
  37.     Color red            = new Color(  255,63, 63);
  38.     
  39.      public String getAppletInfo() {
  40.         return "Scrolling Text by Christoph Schaffhauser";
  41.         }
  42.         
  43.     public void init()
  44.     {
  45.     }
  46.     
  47.     public void paint (Graphics g)
  48.     {        
  49.     }
  50.  
  51.     public boolean mouseUp (Event evt, int x, int y)
  52.     {
  53.         return true;
  54.     }
  55.     
  56.     public void start() {
  57.     if(killme == null) 
  58.         {
  59.                     killme = new Thread(this);
  60.                     killme.start();
  61.         }
  62.      }
  63.  
  64.     public void stop() {
  65.         killme = null;
  66.      }
  67.  
  68.     public void run() {
  69.         Graphics g = getGraphics();
  70.         
  71.         while (killme != null) {
  72.         try {Thread.sleep(1000);} catch (InterruptedException e){}
  73.         
  74.         }
  75.         killme = null;
  76.      }
  77.  
  78.  
  79. }