Package ejmf.toolkit.gui.tickertape

Source Code of ejmf.toolkit.gui.tickertape.TickerTapeApplet

package ejmf.toolkit.gui.tickertape;

import javax.swing.JApplet;
import javax.swing.JFrame;

/**
* TickerTapeApplet is a simple applet to display a TickerTape.
* Use the MESSAGE html tag to specify the message to be
* displayed.
*
* @author     Steve Talley & Rob Gordon
*/
public class TickerTapeApplet extends JApplet {
    TickerTape tickertape;
    JFrame frame;

    public TickerTapeApplet() {
        //  Fix AWT Event Queue check
        getRootPane().putClientProperty(
            "defeatSystemEventQueueCheck", Boolean.TRUE);
    }

    public void init() {
        String message;

        // Get the text to display
        if((message = getParameter("MESSAGE")) == null) {
            System.err.println("Invalid MESSAGE parameter");
            return;
        }

        frame = new JFrame("TickerTape");
        tickertape = new TickerTape(message);
        frame.getContentPane().add(tickertape);
        frame.pack();
    }

    public void start() {
        frame.setVisible(true);
        tickertape.start();
    }

    public void stop() {
        frame.setVisible(false);
        tickertape.stop();
    }

    public void destroy() {
        frame.dispose();
        tickertape = null;
    }
}
TOP

Related Classes of ejmf.toolkit.gui.tickertape.TickerTapeApplet

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.