About.java
  1 /*
  2  * About.java
  3  *
  4  * Created on 13 Август 2006 г., 1:30
  5  */
  6 package rct;
  7 
  8 import javax.swing.ImageIcon;
  9 
 10 /**
 11  *
 12  * @author  roman
 13  */
 14 public class About extends java.awt.Dialog {
 15     
 16     /** Creates new form About */
 17     public About(java.awt.Frame parent, boolean modal) {
 18         super(parent, modal);
 19         initComponents();
 20     }
 21     
 22     /** This method is called from within the constructor to
 23      * initialize the form.
 24      * WARNING: Do NOT modify this code. The content of this method is
 25      * always regenerated by the Form Editor.
 26      */
 27     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
 28     private void initComponents() {
 29         jPanel1 = new javax.swing.JPanel();
 30         jButton1 = new javax.swing.JButton();
 31         jLabel1 = new javax.swing.JLabel();
 32         //jLabel1.setIcon(icon);
 33         jLabel2 = new javax.swing.JLabel();
 34         jLabel3 = new javax.swing.JLabel();
 35         jLabel4 = new javax.swing.JLabel();
 36         jLabel5 = new javax.swing.JLabel();
 37 
 38         setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
 39         setModal(true);
 40         setResizable(false);
 41         setTitle("About");
 42         addWindowListener(new java.awt.event.WindowAdapter() {
 43             public void windowClosing(java.awt.event.WindowEvent evt) {
 44                 closeDialog(evt);
 45             }
 46         });
 47 
 48         jButton1.setText("Ok");
 49         jButton1.setFocusPainted(false);
 50         jButton1.addActionListener(new java.awt.event.ActionListener() {
 51             public void actionPerformed(java.awt.event.ActionEvent evt) {
 52                 jButton1ActionPerformed(evt);
 53             }
 54         });
 55 
 56         jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/rct/rct.jpg")));
 57         jLabel1.setText("\n\n\n");
 58 
 59         jLabel2.setText("\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440.");
 60 
 61         jLabel3.setText("\u041d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 Java.");
 62 
 63         jLabel4.setText("\u0410\u0432\u0442\u043e\u0440: RcT.");
 64 
 65         jLabel5.setText("\u0412\u0435\u0440\u0441\u0438\u044f: 0.1");
 66 
 67         org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
 68         jPanel1.setLayout(jPanel1Layout);
 69         jPanel1Layout.setHorizontalGroup(
 70             jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 71             .add(jPanel1Layout.createSequentialGroup()
 72                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 73                     .add(jPanel1Layout.createSequentialGroup()
 74                         .addContainerGap()
 75                         .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 76                             .add(jLabel2)
 77                             .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 113, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 78                             .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 113, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 79                             .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 113, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 80                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 62, Short.MAX_VALUE)
 81                         .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 82                     .add(jPanel1Layout.createSequentialGroup()
 83                         .add(113, 113, 113)
 84                         .add(jButton1)))
 85                 .addContainerGap())
 86         );
 87         jPanel1Layout.setVerticalGroup(
 88             jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 89             .add(jPanel1Layout.createSequentialGroup()
 90                 .addContainerGap()
 91                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 92                     .add(jLabel1)
 93                     .add(jPanel1Layout.createSequentialGroup()
 94                         .add(jLabel2)
 95                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 96                         .add(jLabel4)
 97                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 98                         .add(jLabel3)
 99                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
100                         .add(jLabel5)))
101                 .add(19, 19, 19)
102                 .add(jButton1)
103                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
104         );
105 
106         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
107         this.setLayout(layout);
108         layout.setHorizontalGroup(
109             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
110             .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
111         );
112         layout.setVerticalGroup(
113             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
114             .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
115         );
116         pack();
117         java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
118         java.awt.Dimension dialogSize = getSize();
119         setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
120     }// </editor-fold>
121 
122     private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
123 // TODO add your handling code here:
124         setVisible(false);
125         dispose();
126     }                                        
127     
128     /** Closes the dialog */
129     private void closeDialog(java.awt.event.WindowEvent evt) {                             
130         setVisible(false);
131         dispose();
132     }                            
133     
134     /**
135      * @param args the command line arguments
136      */
137     public static void main(String args[]) {
138         java.awt.EventQueue.invokeLater(new Runnable() {
139             public void run() {
140                 new About(new java.awt.Frame(), true).setVisible(true);
141             }
142         });
143     }
144     
145    // private ImageIcon icon = new ImageIcon("rct.jpg");
146     
147     // Variables declaration - do not modify
148     private javax.swing.JButton jButton1;
149     private javax.swing.JLabel jLabel1;
150     private javax.swing.JLabel jLabel2;
151     private javax.swing.JLabel jLabel3;
152     private javax.swing.JLabel jLabel4;
153     private javax.swing.JLabel jLabel5;
154     private javax.swing.JPanel jPanel1;
155     // End of variables declaration
156     
157 }
158 

Hosted by uCoz