1 30 package com.genimen.djeneric.tools.common; 31 32 import java.awt.BorderLayout ; 33 import java.awt.Color ; 34 import java.awt.Dimension ; 35 import java.awt.Frame ; 36 import java.awt.Toolkit ; 37 import java.awt.event.ActionEvent ; 38 39 import javax.swing.BorderFactory ; 40 import javax.swing.JButton ; 41 import javax.swing.JDialog ; 42 import javax.swing.JPanel ; 43 import javax.swing.border.BevelBorder ; 44 import javax.swing.border.Border ; 45 46 import com.genimen.djeneric.language.Messages; 47 import com.genimen.djeneric.util.DjLogger; 48 49 public class AboutDialog extends JDialog 50 { 51 private static final long serialVersionUID = 1L; 52 JPanel panel1 = new JPanel (); 53 BorderLayout borderLayout1 = new BorderLayout (); 54 AboutPanel aboutPanel = new AboutPanel(); 55 JPanel jPanel2 = new JPanel (); 56 JPanel jPanel3 = new JPanel (); 57 JButton jButton1 = new JButton (); 58 BorderLayout borderLayout2 = new BorderLayout (); 59 Border border1; 60 61 public AboutDialog(Frame frame) 62 { 63 super(frame, Messages.getString("AboutDialog.AboutDjeneric"), true); 64 try 65 { 66 jbInit(); 67 pack(); 68 69 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 70 Dimension frameSize = getSize(); 71 if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; 72 73 if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; 74 75 setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); 76 77 setVisible(true); 78 } 79 catch (Exception ex) 80 { 81 DjLogger.log(ex); 82 } 83 } 84 85 void jbInit() throws Exception 86 { 87 border1 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white, Color.white, new Color (103, 101, 98), 88 new Color (148, 145, 140)); 89 panel1.setLayout(borderLayout1); 90 jPanel3.setLayout(borderLayout2); 91 jButton1.setText(Messages.getString("global.Ok")); 92 jButton1.addActionListener(new java.awt.event.ActionListener () 93 { 94 public void actionPerformed(ActionEvent e) 95 { 96 jButton1_actionPerformed(e); 97 } 98 }); 99 getContentPane().add(panel1); 100 panel1.add(aboutPanel, BorderLayout.CENTER); 101 panel1.add(jPanel3, BorderLayout.SOUTH); 102 jPanel3.add(jPanel2, BorderLayout.EAST); 103 jPanel2.add(jButton1, null); 104 } 105 106 void jButton1_actionPerformed(ActionEvent e) 107 { 108 setVisible(false); 109 } 110 } | Popular Tags |