FileDocCategorySizeDatePackage
RelativeBeep.javaAPI DocExample773Sat Sep 09 20:33:24 BST 2000None

RelativeBeep

public class RelativeBeep extends Applet implements Runnable

Fields Summary
private AudioClip
beep
private boolean
stopped
Constructors Summary
Methods Summary
public voidinit()


     

    this.beep = this.getAudioClip(this.getDocumentBase(), "sounds/beep.au");
    if (this.beep != null) {
      Thread t = new Thread(this);
      t.start();
    }
  
  
public voidrun()

    
    Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
    while (true) {
      if (!stopped) this.beep.play();
      try {
        Thread.sleep(5000);
      }
      catch (InterruptedException e) {
      }
    }
  
  
public voidstart()

    this.stopped = false;
  
public voidstop()

    this.stopped = true;