神経質なテキスト表示



/*  Daniel Wyszynski 
    Test of text animation.
*/

import java.awt.Graphics;
import java.awt.Font;

public class test014 extends java.applet.Applet implements Runnable {

	char separated[];
	String s = null;
	Thread killme = null;
	int i;
	int x_coord = 0, y_coord = 0;
	String num;
	int speed=35;
	int counter =0;
	boolean threadSuspended = false;

public void init() {
	s = getParameter("text");
	if (s == null) {
	    s = "Shizuoka University of Art and Culture";
	}
	separated =  new char [s.length()];
	s.getChars(0,s.length(),separated,0);
	resize(150,50);
	setFont(new Font("TimesRoman",Font.BOLD,24));
 }

public void start() {
	if(killme == null) 
	{
        killme = new Thread(this);
        killme.start();
	}
 }

public void stop() {
	killme = null;
 }

public void run() {
	while (killme != null) {
	try {Thread.sleep(100);} catch (InterruptedException e){}
	repaint();
	}
	killme = null;
 }

public void paint(Graphics g) {
	for(i=0;i