/Users/lyon/j4p/src/midterm/StreamDelaySliderPanel.java

1    package midterm; 
2     
3    import gui.run.RunSlider; 
4    import javax.swing.*; 
5    import java.awt.*; 
6     import javax.swing.JPanel; 
7    import sound.audioDigitizer.StreamAudio; 
8    import java.awt.*; 
9    import java.awt.BorderLayout; 
10   import java.awt.Container; 
11   import java.awt.GridLayout; 
12    
13    
14   /** 
15    * Created by IntelliJ IDEA. 
16    * User: Dahiana  Martinez 
17    * Date: Dec 4, 2004 
18    * Time: 9:41:30 PM 
19    * To change this template use File | Settings | File Templates. 
20    */ 
21   public class StreamDelaySliderPanel extends JPanel{ 
22       private static StreamAudio sa; 
23     public int x=10; 
24       private int oldx=100; 
25       public StreamDelaySliderPanel (){ 
26           //sa = new StreamAudio(); 
27    
28           setLayout(new BorderLayout()); 
29      add(getDelaySliderPanel(), BorderLayout.CENTER); 
30       } 
31      private JPanel getDelaySliderPanel() { 
32    
33           JPanel controlPanel = new JPanel(new GridLayout(0, 1)); 
34           JLabel label = new JLabel("Audio Delay x 500", JLabel.CENTER); 
35           controlPanel.add(label); 
36    
37           RunSlider rs = new RunSlider(SwingConstants.HORIZONTAL) { 
38               public void run() { 
39                   x =getValue() *10; 
40    
41    
42    
43               } 
44           }; 
45           controlPanel.add(rs); 
46    
47           return controlPanel; 
48       } 
49       public static void main(String[] args) { 
50            StreamDelaySliderPanel sl =new StreamDelaySliderPanel(); 
51           gui.ClosableJFrame cf = new gui.ClosableJFrame(); 
52           Container c = cf.getContentPane(); 
53           c.add(sl); 
54           cf.setSize(200, 150); 
55           cf.show(); 
56           sa.start(); 
57    
58       } 
59   } 
60