KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > DataLoaderTests > DataObjectTest > data > SwingFormObject


1 package DataLoaderTests.DataObjectTest.data;
2
3 /*
4  * SwingFormObject.java
5  *
6  * Created on December 20, 1999, 12:19 PM
7  */

8  
9
10
11 /**
12  *
13  * @author pknakal
14  * @version
15  */

16 public class SwingFormObject extends javax.swing.JFrame JavaDoc {
17
18   /** Creates new form SwingFormObject */
19     public SwingFormObject() {
20     initComponents ();
21     pack ();
22   }
23
24   /** This method is called from within the constructor to
25    * initialize the form.
26    * WARNING: Do NOT modify this code. The content of this method is
27    * always regenerated by the FormEditor.
28    */

29   private void initComponents () {//GEN-BEGIN:initComponents
30
jButton1 = new javax.swing.JButton JavaDoc ();
31     jLabel1 = new javax.swing.JLabel JavaDoc ();
32     addWindowListener (new java.awt.event.WindowAdapter JavaDoc () {
33       public void windowClosing (java.awt.event.WindowEvent JavaDoc evt) {
34         exitForm (evt);
35       }
36     }
37     );
38
39     jButton1.setText ("Close");
40     jButton1.addMouseListener (new java.awt.event.MouseAdapter JavaDoc () {
41       public void mouseClicked (java.awt.event.MouseEvent JavaDoc evt) {
42         jButton1MouseClicked (evt);
43       }
44     }
45     );
46
47
48     getContentPane ().add (jButton1, java.awt.BorderLayout.SOUTH);
49
50     jLabel1.setText ("SwingFormObject");
51     jLabel1.setHorizontalAlignment (javax.swing.SwingConstants.CENTER);
52
53
54     getContentPane ().add (jLabel1, java.awt.BorderLayout.CENTER);
55
56   }//GEN-END:initComponents
57

58 private void jButton1MouseClicked (java.awt.event.MouseEvent JavaDoc evt) {//GEN-FIRST:event_jButton1MouseClicked
59
this.dispose();
60     this.exitForm(null);
61   }//GEN-LAST:event_jButton1MouseClicked
62

63   /** Exit the Application */
64   private void exitForm(java.awt.event.WindowEvent JavaDoc evt) {//GEN-FIRST:event_exitForm
65
System.exit (0);
66   }//GEN-LAST:event_exitForm
67

68   /**
69   * @param args the command line arguments
70   */

71   public static void main (String JavaDoc args[]) {
72     new SwingFormObject ().show ();
73   }
74
75
76   // Variables declaration - do not modify//GEN-BEGIN:variables
77
private javax.swing.JButton JavaDoc jButton1;
78   private javax.swing.JLabel JavaDoc jLabel1;
79   // End of variables declaration//GEN-END:variables
80

81 }
Popular Tags