Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2012
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.42 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package javaguitest;
  6.  
  7. public class NewJFrame extends javax.swing.JFrame {
  8.  
  9.     /**
  10.      * Creates new form NewJFrame
  11.      */
  12.     public NewJFrame() {
  13.         initComponents();
  14.     }
  15.  
  16.     /**
  17.      * This method is called from within the constructor to initialize the form.
  18.      * WARNING: Do NOT modify this code. The content of this method is always
  19.      * regenerated by the Form Editor.
  20.      */
  21.     @SuppressWarnings("unchecked")
  22.     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  23.     private void initComponents() {
  24.  
  25.         jButton1 = new javax.swing.JButton();
  26.         jButton2 = new javax.swing.JButton();
  27.         jButton3 = new javax.swing.JButton();
  28.         jTextField1 = new javax.swing.JTextField();
  29.         jScrollPane1 = new javax.swing.JScrollPane();
  30.         jTree1 = new javax.swing.JTree();
  31.  
  32.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  33.  
  34.         jButton1.setText("jButton1");
  35.  
  36.         jButton2.setText("jButton2");
  37.  
  38.         jButton3.setText("jButton3");
  39.  
  40.         jTextField1.setText("jTextField1");
  41.  
  42.         jScrollPane1.setViewportView(jTree1);
  43.  
  44.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  45.         getContentPane().setLayout(layout);
  46.         layout.setHorizontalGroup(
  47.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  48.             .addGroup(layout.createSequentialGroup()
  49.                 .addContainerGap()
  50.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  51.                     .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE)
  52.                     .addComponent(jTextField1))
  53.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  54.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  55.                     .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING)
  56.                     .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING)
  57.                     .addComponent(jButton3, javax.swing.GroupLayout.Alignment.TRAILING))
  58.                 .addContainerGap())
  59.         );
  60.         layout.setVerticalGroup(
  61.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  62.             .addGroup(layout.createSequentialGroup()
  63.                 .addContainerGap()
  64.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  65.                     .addComponent(jButton1)
  66.                     .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  67.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  68.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  69.                     .addGroup(layout.createSequentialGroup()
  70.                         .addComponent(jButton2)
  71.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  72.                         .addComponent(jButton3))
  73.                     .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE))
  74.                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  75.         );
  76.  
  77.         pack();
  78.     }// </editor-fold>                        
  79.  
  80.     /**
  81.      * @param args the command line arguments
  82.      */
  83.     public static void main(String args[]) {
  84.         /*
  85.          * Set the Nimbus look and feel
  86.          */
  87.         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  88.         /*
  89.          * If Nimbus (introduced in Java SE 6) is not available, stay with the
  90.          * default look and feel. For details see
  91.          * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  92.          */
  93.         try {
  94.             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  95.                 if ("Nimbus".equals(info.getName())) {
  96.                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
  97.                     break;
  98.                 }
  99.             }
  100.         } catch (ClassNotFoundException ex) {
  101.             java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  102.         } catch (InstantiationException ex) {
  103.             java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  104.         } catch (IllegalAccessException ex) {
  105.             java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  106.         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  107.             java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  108.         }
  109.         //</editor-fold>
  110.  
  111.         /*
  112.          * Create and display the form
  113.          */
  114.         java.awt.EventQueue.invokeLater(new Runnable() {
  115.  
  116.             public void run() {
  117.                 new NewJFrame().setVisible(true);
  118.             }
  119.         });
  120.     }
  121.     // Variables declaration - do not modify                    
  122.     private javax.swing.JButton jButton1;
  123.     private javax.swing.JButton jButton2;
  124.     private javax.swing.JButton jButton3;
  125.     private javax.swing.JScrollPane jScrollPane1;
  126.     private javax.swing.JTextField jTextField1;
  127.     private javax.swing.JTree jTree1;
  128.     // End of variables declaration                  
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement