/Users/lyon/j4p/src/j3d/viewer/InfoDialog.java

1    package j3d.viewer; 
2     
3    /* 
4     * 
5     * (c) September 1998 by Mauro Marinilli 
6     * 
7     */ 
8     
9    import javax.swing.*; 
10   import java.awt.*; 
11   import java.awt.event.MouseEvent; 
12    
13   public class InfoDialog extends JDialog { 
14       JPanel jPanel1 = new JPanel(); 
15       JPanel panel1 = new JPanel(); 
16       BorderLayout borderLayout1 = new BorderLayout(); 
17       JButton jButton1 = new JButton(); 
18       JLabel jLabel1 = new JLabel(); 
19       ImageIcon tree = new ImageIcon("tree_mid.gif"); 
20       BorderLayout borderLayout3 = new BorderLayout(); 
21       JPanel jPanel2 = new JPanel(); 
22       JLabel jLabel2 = new JLabel(); 
23       BorderLayout borderLayout2 = new BorderLayout(); 
24       JPanel jPanel3 = new JPanel(); 
25    
26    
27       public InfoDialog(Frame frame, String title, boolean modal) { 
28           super(frame, title, modal); 
29           try { 
30               draw(); 
31               pack(); 
32           } catch (Exception ex) { 
33               ex.printStackTrace(); 
34           } 
35       } 
36    
37    
38       public InfoDialog(Frame f) { 
39           this(f, "Java 3D Scene Graph Viewer version 0.101 Sept.1998", true); 
40       } 
41    
42       void draw() throws Exception { 
43           panel1.setLayout(borderLayout1); 
44           jPanel1.setLayout(borderLayout3); 
45           panel1.setBackground(Color.white); 
46           jButton1.setText("OK"); 
47           jLabel1.setText("Java3D Scene Viewer (c) 1998 Mauro Marinilli   "); 
48           jLabel1.setBackground(Color.white); 
49           jLabel1.setFont(new Font("TimesRoman", 0, 18)); 
50           jPanel2.setLayout(borderLayout2); 
51           jLabel2.setIcon(tree); 
52           jPanel3.setBackground(SystemColor.controlHighlight); 
53           jButton1.addMouseListener(new java.awt.event.MouseAdapter() { 
54               public void mouseClicked(MouseEvent e) { 
55                   jButton1_mouseClicked(e); 
56               } 
57           }); 
58           getContentPane().add(panel1); 
59           panel1.add(jPanel1, BorderLayout.WEST); 
60           panel1.add(jLabel1, BorderLayout.EAST); 
61           panel1.add(jPanel2, BorderLayout.WEST); 
62           jPanel2.add(jLabel2, BorderLayout.NORTH); 
63           panel1.add(jPanel3, BorderLayout.SOUTH); 
64           jPanel3.add(jButton1, null); 
65           setSize(472, 166); 
66           setResizable(false); 
67           show(); 
68       } 
69    
70       void jButton1_mouseClicked(MouseEvent e) { 
71           dispose(); 
72       } 
73   } 
74    
75       
76