/Users/lyon/j4p/src/rtf/DocUtilGui.java

1    package rtf; 
2     
3    import futils.Futil; 
4    import gui.run.DirectoryGui; 
5    import gui.run.RunButton; 
6     
7    import javax.swing.*; 
8    import java.awt.*; 
9     
10   /** 
11    * Copyright DocJava, inc. User: lyon Date: Aug 
12    * 18, 2004 Time: 9:40:41 AM 
13    */ 
14    
15   public class DocUtilGui { 
16       JFrame jf = new JFrame(); 
17       private final DirectoryGui directoryGui = 
18               new DirectoryGui(); 
19    
20    
21       public DocUtilGui() { 
22           getPanels(); 
23       } 
24    
25       private JPanel getPanels() { 
26           JPanel jp = new JPanel(); 
27           jp.setLayout(new BorderLayout()); 
28           jp.add(getOkCancelPanel(), 
29                   BorderLayout.SOUTH); 
30           jp.add( 
31                   directoryGui.getFilePanel( 
32                           "src directory"), 
33                   BorderLayout.NORTH); 
34           return jp; 
35       } 
36    
37       public static void main(String[] args) { 
38           Futil.setLookAndFeel(); 
39           Futil.setSwing(true); 
40           DocUtilGui dug = new DocUtilGui(); 
41           dug.testDocUtilBean(); 
42       } 
43    
44       public void testDocUtilBean() { 
45    
46           Container c = jf.getContentPane(); 
47           c.add(getPanels()); 
48           jf.setSize(300, 300); 
49           jf.show(); 
50       } 
51    
52       private JPanel getOkCancelPanel() { 
53           JPanel jp = new JPanel(); 
54           jp.add(new RunButton("[ok") { 
55               public void run() { 
56                   jf.hide(); 
57               } 
58           }); 
59           jp.add(new RunButton("[Exit") { 
60               public void run() { 
61                   jf.hide(); 
62                   System.exit(0); 
63               } 
64           }); 
65           jp.setLayout(new FlowLayout()); 
66           return jp; 
67       } 
68   } 
69