1 package DataLoaderTests.DataObjectTest.data; 2 3 8 9 10 11 16 public class SwingFormObject extends javax.swing.JFrame { 17 18 19 public SwingFormObject() { 20 initComponents (); 21 pack (); 22 } 23 24 29 private void initComponents () { jButton1 = new javax.swing.JButton (); 31 jLabel1 = new javax.swing.JLabel (); 32 addWindowListener (new java.awt.event.WindowAdapter () { 33 public void windowClosing (java.awt.event.WindowEvent evt) { 34 exitForm (evt); 35 } 36 } 37 ); 38 39 jButton1.setText ("Close"); 40 jButton1.addMouseListener (new java.awt.event.MouseAdapter () { 41 public void mouseClicked (java.awt.event.MouseEvent 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 } 58 private void jButton1MouseClicked (java.awt.event.MouseEvent evt) { this.dispose(); 60 this.exitForm(null); 61 } 63 64 private void exitForm(java.awt.event.WindowEvent evt) { System.exit (0); 66 } 68 71 public static void main (String args[]) { 72 new SwingFormObject ().show (); 73 } 74 75 76 private javax.swing.JButton jButton1; 78 private javax.swing.JLabel jLabel1; 79 81 } | Popular Tags |