/** * ScrollTextApplet.java - Scrolling text applet * * @author Philip Meese * @version 1.0, 3/16/96 Java Tutor, Second and Third Column */ import java.awt.*; import java.applet.Applet; import ScrollText; public class ScrollTextApplet extends Applet{ ScrollText _scrollText; String _message; int _speed; int _width, _height; boolean _started=false; public void init(){ processParms(); // set up a panel and put a scrolltext object in it _scrollText=new ScrollText(_message, _width, _height); _scrollText.speed(_speed); setLayout(new BorderLayout()); add("Center", _scrollText); } public void processParms(){ String speedParm; _width=Integer.parseInt(getParameter("width")); _height=Integer.parseInt(getParameter("height")); speedParm=getParameter("speed"); if(speedParm == null) _speed=50; else _speed=Integer.parseInt(speedParm); _message=getParameter("message"); if(_message == null) _message=new String("The Java Tutor Message Board"); } public void start(){ if(!_started) _scrollText.start(); else _scrollText.resume(); _started=true; } public void stop(){ _scrollText.suspend(); } public void destroy(){ _scrollText.suspend(); } } // end class ScrollTextApplet