import java.applet.Applet;
import java.awt.Graphics;

public class myCounter extends Applet implements Runnable {
	Thread myThread = null;
	int startCount = 0;  
	int stopCount = 0;  
	int count = 0;  
	public void init() { resize(350,25); }

	public void start() {
		startCount ++;
		if (myThread == null) {
		myThread = new Thread(this); 
		myThread.start();
		}
	}

	public void stop() { 
		stopCount++;
		myThread = null; 
	}

	public void run() {
		while(myThread != null) {
			count++;
			try {Thread.sleep(1000);} 
			catch (InterruptedException e){}
			repaint();
		} 
	}
	public void paint (Graphics g) {
		showStatus("Uykka");
		System.out.println("Schmapa");
		g.drawString("Stop " + stopCount + " Start " + startCount + 
			" Count: " + count, 10, 25);
	}
}
