Advertisement
stevennathaniel

Form Test Koneksi di Java

Feb 9th, 2015
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.46 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package formPilihan;
  7.  
  8. /**
  9.  *
  10.  * @author steven
  11.  */
  12. public class formTestKoneksi extends javax.swing.JFrame {
  13.  
  14.     /**
  15.      * Creates new form formTestKoneksi
  16.      */
  17.     public formTestKoneksi() {
  18.         initComponents();
  19.     }
  20.  
  21.     /**
  22.      * This method is called from within the constructor to initialize the form.
  23.      * WARNING: Do NOT modify this code. The content of this method is always
  24.      * regenerated by the Form Editor.
  25.      */
  26.     @SuppressWarnings("unchecked")
  27.     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  28.     private void initComponents() {
  29.  
  30.         jButton1 = new javax.swing.JButton();
  31.  
  32.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  33.  
  34.         jButton1.setFont(new java.awt.Font("Cantarell", 1, 15)); // NOI18N
  35.         jButton1.setText("Test Koneksi");
  36.         jButton1.addActionListener(new java.awt.event.ActionListener() {
  37.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  38.                 jButton1ActionPerformed(evt);
  39.             }
  40.         });
  41.  
  42.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  43.         getContentPane().setLayout(layout);
  44.         layout.setHorizontalGroup(
  45.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  46.             .addGroup(layout.createSequentialGroup()
  47.                 .addContainerGap()
  48.                 .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE)
  49.                 .addContainerGap(179, Short.MAX_VALUE))
  50.         );
  51.         layout.setVerticalGroup(
  52.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  53.             .addGroup(layout.createSequentialGroup()
  54.                 .addContainerGap()
  55.                 .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
  56.                 .addContainerGap(230, Short.MAX_VALUE))
  57.         );
  58.  
  59.         pack();
  60.     }// </editor-fold>                        
  61.  
  62.     private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  63.         // TODO add your handling code here:
  64.        
  65.         kelasKoneksi obj = new kelasKoneksi();
  66.        
  67.         obj.Sambungan();
  68.     }                                        
  69.  
  70.     /**
  71.      * @param args the command line arguments
  72.      */
  73.     public static void main(String args[]) {
  74.         /* Set the Nimbus look and feel */
  75.         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  76.         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  77.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  78.          */
  79.         try {
  80.             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  81.                 if ("Nimbus".equals(info.getName())) {
  82.                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
  83.                     break;
  84.                 }
  85.             }
  86.         } catch (ClassNotFoundException ex) {
  87.             java.util.logging.Logger.getLogger(formTestKoneksi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  88.         } catch (InstantiationException ex) {
  89.             java.util.logging.Logger.getLogger(formTestKoneksi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  90.         } catch (IllegalAccessException ex) {
  91.             java.util.logging.Logger.getLogger(formTestKoneksi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  92.         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  93.             java.util.logging.Logger.getLogger(formTestKoneksi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  94.         }
  95.         //</editor-fold>
  96.  
  97.         /* Create and display the form */
  98.         java.awt.EventQueue.invokeLater(new Runnable() {
  99.             public void run() {
  100.                 new formTestKoneksi().setVisible(true);
  101.             }
  102.         });
  103.     }
  104.  
  105.     // Variables declaration - do not modify                    
  106.     private javax.swing.JButton jButton1;
  107.     // End of variables declaration                  
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement