/Users/lyon/j4p/src/sound/soundDemo/JavaSoundApplet.java

1    package sound.soundDemo; 
2     
3    /* 
4     * Copyright 2002 Sun Microsystems, Inc. All rights reserved. 
5     * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 
6     */ 
7     
8    import javax.swing.*; 
9    import java.awt.*; 
10    
11   /** 
12    * A demo that shows JavaSound features. 
13    * 
14    * Parameters that can be used in the JavaSound.html file inside 
15    * the applet tag to customize demo runs : 
16    *            <param name="dir" value="audioDirectory"> 
17    * 
18    * JavaSoundApplet.java 1.4 02/02/06 
19    * @author Brian Lichtenwalter 
20    */ 
21   public class JavaSoundApplet extends JApplet { 
22    
23       static JavaSoundApplet applet; 
24       private JavaSound demo; 
25    
26       public void init() { 
27           applet = this; 
28           String media = "media"; 
29           String param = null; 
30           if ((param = getParameter("dir")) != null) { 
31               media = param; 
32           } 
33           demo = new JavaSound(media); 
34           Container contentPane = getContentPane(); 
35           contentPane.add(demo.getPanel()); 
36       } 
37    
38       public void start() { 
39           demo.open(); 
40       } 
41    
42       public void stop() { 
43           demo.close(); 
44       } 
45   } 
46