1 package com.piratepete.dbpirate.ui; 2 3 import javax.swing.*; 4 import java.awt.event.*; 5 import java.awt.*; 6 7 8 31 32 33 public class About extends JDialog { 34 35 36 37 public About(Frame parent, boolean modal) { 38 super(parent, modal); 39 initComponents(); 40 setSize(new Dimension(387,375)); 41 setLocation(250,250); 42 setVisible(true); 43 44 45 } 46 47 private void initComponents() { 48 49 jLabel1 = new JLabel(); 50 jButton1 = new JButton(); 51 52 getContentPane().setLayout(null); 53 54 setResizable(false); 55 addWindowListener(new WindowAdapter() { 56 57 public void windowClosing(WindowEvent evt) { 58 closeDialog(evt); 59 } 60 }); 61 62 63 jLabel1.setIcon(new ImageIcon(getClass().getResource("/com/piratepete/dbpirate/ui/images/splash.png"))); 64 65 getContentPane().add(jLabel1); 66 67 jLabel1.setBounds(10, 10, 360, 290); 68 69 jButton1.setForeground(new Color(0, 0, 0)); 70 jButton1.setText("Ok"); 71 72 jButton1.addActionListener(new ActionListener() { 73 public void actionPerformed(ActionEvent evt) { 74 jButton1ActionPerformed(evt); 75 } 76 }); 77 78 79 getContentPane().add(jButton1); 80 jButton1.setBounds(170, 310, 60, 26); 81 82 pack(); 83 } 84 85 86 87 private void jButton1ActionPerformed(ActionEvent evt) { 88 setVisible(false); 90 dispose(); 91 } 92 93 94 95 96 private void closeDialog(WindowEvent evt) { 97 setVisible(false); 98 dispose(); 99 } 100 101 102 103 106 110 111 112 private JButton jButton1; 114 private JLabel jLabel1; 115 116 117 } 118 119 | Popular Tags |