/Users/lyon/j4p/src/ip/gui/dialog/MatLog.java

1    package ip.gui.dialog; 
2     
3    import ip.gui.frames.ClosableFrame; 
4     
5    import java.awt.*; 
6     
7     
8    public class MatLog extends 
9            ClosableFrame { 
10    
11       private int fieldSize; 
12    
13       private static int colSpace = 5; 
14       private static int rowSpace = 5; 
15    
16       private Panel inputPanel = new Panel(); 
17    
18       public MatLog( 
19               float f[][]) { 
20    
21           super("Kernal"); 
22           initialize(f); 
23           pack(); 
24           show(); 
25       } 
26    
27       private void initialize( 
28               float f[][]) { 
29    
30           fieldSize = 3; 
31           int rowNum = f.length; 
32           int colNum = f[0].length; 
33    
34           inputPanel.setLayout(new 
35                   GridLayout( 
36                           rowNum, colNum, rowSpace, colSpace)); 
37           for (int x = 0; x < rowNum; x++) 
38               for (int y = 0; y < colNum; y++) 
39                   inputPanel.add(new Label(f[x][y] + " ")); 
40           add("Center", inputPanel); 
41           pack(); 
42           show(); 
43       } 
44    
45       public static void main(String args[]) { 
46           float k[][] = { 
47               {0, -1, 0}, 
48               {-1, 10, -1}, 
49               {0, -1, 0} 
50           }; 
51    
52           MatLog ml = new MatLog(k); 
53       } 
54   } 
55    
56    
57    
58    
59    
60    
61    
62