package com.BlossomAssociates.keyboard; import java.applet.AudioClip; import java.awt.event.*; /** * Plays a note. * Need to extend Thread. * Need to implement key listener instead of ActionListener. * Need to start on key down, stop on key up. */ public class Sounder implements ActionListener { private AudioClip note; public Sounder( AudioClip theNote ) { if ( null == theNote ) { throw new IllegalArgumentException( "theNote may not be null." ); } this.note = theNote; } public void actionPerformed( ActionEvent ae ) { this.note.play(); System.out.println( "beep" ); } }