/Users/lyon/j4p/src/gui/touchtone/TouchToneButtonPad.java

1    package gui.touchtone; 
2     
3     
4    public class TouchToneButtonPad { 
5        private java.awt.Container outerFrameContainer; 
6        private gui.touchtone.TouchToneModel ttm; 
7     
8        public TouchToneButtonPad(java.awt.Container c, 
9                                  gui.touchtone.TouchToneModel _ttc) { 
10           outerFrameContainer = c; 
11           java.awt.GridLayout gl = new java.awt.GridLayout(4, 0); 
12           gl.setHgap(5); 
13           gl.setColumns(4); 
14           gl.setVgap(5); 
15           outerFrameContainer.setLayout(gl); 
16           ttm = _ttc; 
17           addButtons(); 
18       } 
19    
20    
21       private void addButtons() { 
22           for (int i = 1; i <= 9; i++) 
23               addRunButton("" + i); 
24           addRunButton("*"); 
25           addRunButton("0"); 
26           addRunButton("#"); 
27       } 
28    
29       private void addRunButton(String s) { 
30           outerFrameContainer.add(new gui.run.RunButton("["+s) { 
31               public void run() { 
32                   ttm.dialPadKey(getText()); 
33               } 
34           } 
35           ); 
36       } 
37   }