FileDocCategorySizeDatePackage
UpdateApplet.javaAPI DocExample756Sat Apr 23 22:35:36 BST 2005None

UpdateApplet

public class UpdateApplet extends Applet implements Runnable

Fields Summary
Thread
thread
boolean
running
int
updateInterval
Constructors Summary
Methods Summary
public voidrun()


       
        while ( running ) 
		{
            repaint();
            try {
                Thread.sleep( updateInterval );
            } catch ( InterruptedException e ) {
				System.out.println("interrupted...");
                return;
            }
        }
    
public voidstart()

		System.out.println("starting...");
        if ( !running ) // naive approach
		{
			running = true;
            thread = new Thread(this);
            thread.start();
		}
    
public voidstop()

		System.out.println("stopping...");
		thread.interrupt();
		running = false;