Advertisement
ljukk

svet.frame

May 28th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.03 KB | None | 0 0
  1. public class JFrame extends javax.swing.JFrame {
  2.  
  3.     public Svetluska s;
  4.    
  5.     public JFrame() {
  6.         initComponents();
  7.        
  8.         s = new Svetluska();
  9.         this.add(s);
  10.        
  11.     }
  12.  
  13.     /**
  14.      * This method is called from within the constructor to initialize the form.
  15.      * WARNING: Do NOT modify this code. The content of this method is always
  16.      * regenerated by the Form Editor.
  17.      */
  18.     @SuppressWarnings("unchecked")
  19.     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  20.     private void initComponents() {
  21.  
  22.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  23.  
  24.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  25.         getContentPane().setLayout(layout);
  26.         layout.setHorizontalGroup(
  27.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  28.             .addGap(0, 400, Short.MAX_VALUE)
  29.         );
  30.         layout.setVerticalGroup(
  31.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  32.             .addGap(0, 300, Short.MAX_VALUE)
  33.         );
  34.  
  35.         pack();
  36.     }// </editor-fold>                        
  37.  
  38.     /**
  39.      * @param args the command line arguments
  40.      */
  41.     public static void main(String args[]) {
  42.         /* Set the Nimbus look and feel */
  43.         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  44.         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  45.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  46.          */
  47.         try {
  48.             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  49.                 if ("Nimbus".equals(info.getName())) {
  50.                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
  51.                     break;
  52.                 }
  53.             }
  54.         } catch (ClassNotFoundException ex) {
  55.             java.util.logging.Logger.getLogger(JFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  56.         } catch (InstantiationException ex) {
  57.             java.util.logging.Logger.getLogger(JFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  58.         } catch (IllegalAccessException ex) {
  59.             java.util.logging.Logger.getLogger(JFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  60.         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  61.             java.util.logging.Logger.getLogger(JFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  62.         }
  63.         //</editor-fold>
  64.  
  65.         /* Create and display the form */
  66.         java.awt.EventQueue.invokeLater(new Runnable() {
  67.             public void run() {
  68.                 new JFrame().setVisible(true);
  69.             }
  70.         });
  71.     }
  72.  
  73.     // Variables declaration - do not modify                    
  74.     // End of variables declaration                  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement