/Users/lyon/j4p/src/sound/AudioApplet.java

1    package sound; 
2     
3    import java.applet.Applet; 
4    import java.applet.AppletContext; 
5    import java.applet.AudioClip; 
6    import java.awt.*; 
7    import java.net.URL; 
8     
9    public class AudioApplet extends Applet { 
10       AudioClip ac = null; 
11       AppletContext appletContext = null; 
12       Frame f = new Frame(); 
13    
14       public AudioApplet(URL url) { 
15           f.add(this); 
16           f.setVisible(true); 
17           ac = getAudioClip(url); 
18       } 
19       public void test() { 
20    
21       } 
22    
23       public void play() { 
24           ac.play(); 
25       } 
26    
27       public AppletContext getAppletContext() { 
28           return appletContext; 
29       } 
30   } 
31