001: /*
002: JSmooth: a VM wrapper toolkit for Windows
003: Copyright (C) 2003 Rodrigo Reyes <reyes@charabia.net>
004:
005: This program is free software; you can redistribute it and/or modify
006: it under the terms of the GNU General Public License as published by
007: the Free Software Foundation; either version 2 of the License, or
008: (at your option) any later version.
009:
010: This program is distributed in the hope that it will be useful,
011: but WITHOUT ANY WARRANTY; without even the implied warranty of
012: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013: GNU General Public License for more details.
014:
015: You should have received a copy of the GNU General Public License
016: along with this program; if not, write to the Free Software
017: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
018:
019: */
020:
021: package net.charabia.jsmoothgen.application.gui;
022:
023: /**
024: *
025: * @author Rodrigo
026: */
027: public class AboutBox extends javax.swing.JDialog {
028:
029: /** Creates new form AboutBox */
030: public AboutBox(java.awt.Frame parent, boolean modal) {
031: super (parent, modal);
032: initComponents();
033: m_licenceTextArea.setCaretPosition(0);
034: }
035:
036: public void setVersion(String vers) {
037: m_labelVersion.setText(vers);
038: }
039:
040: /** This method is called from within the constructor to
041: * initialize the form.
042: * WARNING: Do NOT modify this code. The content of this method is
043: * always regenerated by the Form Editor.
044: */
045: private void initComponents()//GEN-BEGIN:initComponents
046: {
047: java.awt.GridBagConstraints gridBagConstraints;
048:
049: jPanel1 = new javax.swing.JPanel();
050: jLabel3 = new javax.swing.JLabel();
051: m_labelVersion = new javax.swing.JLabel();
052: jLabel5 = new javax.swing.JLabel();
053: jLabel1 = new javax.swing.JLabel();
054: jLabel2 = new javax.swing.JLabel();
055: jScrollPane1 = new javax.swing.JScrollPane();
056: m_licenceTextArea = new javax.swing.JTextArea();
057: jPanel2 = new javax.swing.JPanel();
058: m_buttonOk = new javax.swing.JButton();
059:
060: setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
061: setTitle("About JSmooth");
062: setModal(true);
063: setResizable(false);
064: addWindowListener(new java.awt.event.WindowAdapter() {
065: public void windowClosing(java.awt.event.WindowEvent evt) {
066: closeDialog(evt);
067: }
068: });
069:
070: jPanel1.setLayout(new java.awt.GridBagLayout());
071:
072: jPanel1.setBorder(new javax.swing.border.CompoundBorder(
073: new javax.swing.border.EmptyBorder(new java.awt.Insets(
074: 5, 5, 5, 5)),
075: new javax.swing.border.EtchedBorder()));
076: jLabel3
077: .setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
078: jLabel3.setText("<html><big>JSmooth</big></html>");
079: gridBagConstraints = new java.awt.GridBagConstraints();
080: gridBagConstraints.gridx = 2;
081: gridBagConstraints.gridy = 1;
082: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
083: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
084: gridBagConstraints.weightx = 0.5;
085: jPanel1.add(jLabel3, gridBagConstraints);
086:
087: m_labelVersion
088: .setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
089: m_labelVersion.setText("Unknown Version");
090: gridBagConstraints = new java.awt.GridBagConstraints();
091: gridBagConstraints.gridy = 2;
092: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
093: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
094: gridBagConstraints.weightx = 0.5;
095: jPanel1.add(m_labelVersion, gridBagConstraints);
096:
097: jLabel5
098: .setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
099: jLabel5.setIcon(new javax.swing.ImageIcon(getClass()
100: .getResource("/icons/gnome-application-x-jar.png")));
101: gridBagConstraints = new java.awt.GridBagConstraints();
102: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
103: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
104: gridBagConstraints.weightx = 0.1;
105: jPanel1.add(jLabel5, gridBagConstraints);
106:
107: jLabel1
108: .setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
109: jLabel1.setText("<html><b>Author</b></html>");
110: gridBagConstraints = new java.awt.GridBagConstraints();
111: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
112: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
113: gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0);
114: jPanel1.add(jLabel1, gridBagConstraints);
115:
116: jLabel2
117: .setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
118: jLabel2.setText("Rodrigo Reyes <reyes@charabia.net>");
119: gridBagConstraints = new java.awt.GridBagConstraints();
120: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
121: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
122: jPanel1.add(jLabel2, gridBagConstraints);
123:
124: m_licenceTextArea.setEditable(false);
125: m_licenceTextArea.setLineWrap(true);
126: m_licenceTextArea
127: .setText("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.");
128: m_licenceTextArea.setWrapStyleWord(true);
129: jScrollPane1.setViewportView(m_licenceTextArea);
130:
131: gridBagConstraints = new java.awt.GridBagConstraints();
132: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
133: gridBagConstraints.gridheight = 3;
134: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
135: gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
136: gridBagConstraints.weightx = 1.0;
137: gridBagConstraints.weighty = 1.0;
138: jPanel1.add(jScrollPane1, gridBagConstraints);
139:
140: getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
141:
142: m_buttonOk.setText("OK");
143: m_buttonOk
144: .addActionListener(new java.awt.event.ActionListener() {
145: public void actionPerformed(
146: java.awt.event.ActionEvent evt) {
147: buttonOkActionPerformed(evt);
148: }
149: });
150:
151: jPanel2.add(m_buttonOk);
152:
153: getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
154:
155: java.awt.Dimension screenSize = java.awt.Toolkit
156: .getDefaultToolkit().getScreenSize();
157: setBounds((screenSize.width - 450) / 2,
158: (screenSize.height - 350) / 2, 450, 350);
159: }//GEN-END:initComponents
160:
161: private void buttonOkActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_buttonOkActionPerformed
162: {//GEN-HEADEREND:event_buttonOkActionPerformed
163: // Add your handling code here:
164: dispose();
165: }//GEN-LAST:event_buttonOkActionPerformed
166:
167: /** Closes the dialog */
168: private void closeDialog(java.awt.event.WindowEvent evt)//GEN-FIRST:event_closeDialog
169: {
170: setVisible(false);
171: dispose();
172: }//GEN-LAST:event_closeDialog
173:
174: /**
175: * @param args the command line arguments
176: */
177: public static void main(String args[]) {
178: new AboutBox(new javax.swing.JFrame(), true).setVisible(true);
179: }
180:
181: // Variables declaration - do not modify//GEN-BEGIN:variables
182: private javax.swing.JLabel jLabel1;
183: private javax.swing.JLabel jLabel2;
184: private javax.swing.JLabel jLabel3;
185: private javax.swing.JLabel jLabel5;
186: private javax.swing.JPanel jPanel1;
187: private javax.swing.JPanel jPanel2;
188: private javax.swing.JScrollPane jScrollPane1;
189: private javax.swing.JButton m_buttonOk;
190: private javax.swing.JLabel m_labelVersion;
191: private javax.swing.JTextArea m_licenceTextArea;
192: // End of variables declaration//GEN-END:variables
193:
194: }
|