FileDocCategorySizeDatePackage
UpdateApplet.javaAPI DocExample570Thu Jun 06 09:58:14 BST 1996exploringjava.threads

UpdateApplet

public class UpdateApplet extends Applet implements Runnable

Fields Summary
private Thread
updateThread
int
updateInterval
Constructors Summary
Methods Summary
public voidrun()


	   
		while ( true ) {
			try {  
				Thread.sleep( updateInterval ); 
			} catch (InterruptedException e ) { 
				return;
			 }
			repaint();
		}
	
public voidstart()

		if ( updateThread == null ) {
			updateThread = new Thread(this);
			updateThread.start();
		}
	
public voidstop()

		if ( updateThread != null ) {
			updateThread.stop();
			updateThread = null;
		}