1 package DataLoaderTests.DataObjectTest.data.Package; 6 7 8 9 14 public class SwingFormObject extends javax.swing.JFrame { 15 16 17 public SwingFormObject() { 18 initComponents (); 19 pack (); 20 } 21 22 27 private void initComponents () { jButton1 = new javax.swing.JButton (); 29 jLabel1 = new javax.swing.JLabel (); 30 addWindowListener (new java.awt.event.WindowAdapter () { 31 public void windowClosing (java.awt.event.WindowEvent evt) { 32 exitForm (evt); 33 } 34 } 35 ); 36 37 jButton1.setText ("Close"); 38 jButton1.addMouseListener (new java.awt.event.MouseAdapter () { 39 public void mouseClicked (java.awt.event.MouseEvent evt) { 40 jButton1MouseClicked (evt); 41 } 42 } 43 ); 44 45 46 getContentPane ().add (jButton1, java.awt.BorderLayout.SOUTH); 47 48 jLabel1.setText ("dataObjectsInPkg/SwingFormObject"); 49 jLabel1.setHorizontalAlignment (javax.swing.SwingConstants.CENTER); 50 51 52 getContentPane ().add (jLabel1, java.awt.BorderLayout.CENTER); 53 54 } 56 private void jButton1MouseClicked (java.awt.event.MouseEvent evt) { this.dispose(); 58 this.exitForm(null); 59 } 61 62 private void exitForm(java.awt.event.WindowEvent evt) { System.exit (0); 64 } 66 69 public static void main (String args[]) { 70 new SwingFormObject ().show (); 71 } 72 73 74 private javax.swing.JButton jButton1; 76 private javax.swing.JLabel jLabel1; 77 79 } | Popular Tags |