Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/meowers/cide/edcide/AboutDialog.java


1   /*
2    * AboutDialog.java
3    *
4    * Created on February 6, 2002, 6:58 PM
5    */
6   
7   package org.meowers.cide.edcide;
8   
9   import org.meowers.cide.data.*;
10  /**
11   *
12   * @author  praxis
13   */
14  public class AboutDialog extends javax.swing.JDialog {
15  
16      /** Creates new form AboutDialog */
17      public AboutDialog(java.awt.Frame parent, boolean modal, String version) {
18          super(parent, modal);
19          initComponents();
20          int fileVersion = GameDataIO.FILE_VERSION;
21          versionLabel.setText("EdCide Version " + version + " (File Format " + fileVersion + ")");
22          versionLabel.setSize(new java.awt.Dimension(350, 100));
23          pack();
24      }
25  
26      /** This method is called from within the constructor to
27       * initialize the form.
28       * WARNING: Do NOT modify this code. The content of this method is
29       * always regenerated by the Form Editor.
30       */
31      private void initComponents() {//GEN-BEGIN:initComponents
32          centerPanel = new javax.swing.JPanel();
33          versionLabel = new javax.swing.JLabel();
34          southPanel = new javax.swing.JPanel();
35          closeButton = new javax.swing.JButton();
36          
37          setTitle("About");
38          setModal(true);
39          setResizable(false);
40          addWindowListener(new java.awt.event.WindowAdapter() {
41              public void windowClosing(java.awt.event.WindowEvent evt) {
42                  closeDialog(evt);
43              }
44          });
45          
46          centerPanel.setLayout(new java.awt.GridLayout(1, 0));
47          
48          centerPanel.setPreferredSize(new java.awt.Dimension(350, 75));
49          centerPanel.setMinimumSize(new java.awt.Dimension(350, 75));
50          versionLabel.setText("Version");
51          versionLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
52          versionLabel.setPreferredSize(new java.awt.Dimension(350, 75));
53          versionLabel.setBorder(new javax.swing.border.TitledBorder("Version Information"));
54          versionLabel.setMinimumSize(new java.awt.Dimension(350, 75));
55          versionLabel.setMaximumSize(new java.awt.Dimension(350, 75));
56          centerPanel.add(versionLabel);
57          
58          getContentPane().add(centerPanel, java.awt.BorderLayout.CENTER);
59          
60          closeButton.setText("Close");
61          closeButton.setMaximumSize(new java.awt.Dimension(350, 350));
62          closeButton.addActionListener(new java.awt.event.ActionListener() {
63              public void actionPerformed(java.awt.event.ActionEvent evt) {
64                  closeButtonActionPerformed(evt);
65              }
66          });
67          
68          southPanel.add(closeButton);
69          
70          getContentPane().add(southPanel, java.awt.BorderLayout.SOUTH);
71          
72          pack();
73      }//GEN-END:initComponents
74  
75      private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
76          hide();
77      }//GEN-LAST:event_closeButtonActionPerformed
78  
79      /** Closes the dialog */
80      private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
81          setVisible(false);
82          dispose();
83      }//GEN-LAST:event_closeDialog
84  
85      /**
86      * @param args the command line arguments
87      */
88      public static void main(String args[]) {
89          new AboutDialog(new javax.swing.JFrame(), true, "None").show();
90      }
91  
92  
93      // Variables declaration - do not modify//GEN-BEGIN:variables
94      private javax.swing.JPanel centerPanel;
95      private javax.swing.JLabel versionLabel;
96      private javax.swing.JPanel southPanel;
97      private javax.swing.JButton closeButton;
98      // End of variables declaration//GEN-END:variables
99  
100 }