Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Sidney Castro
Added: Oct 7, 2018 6:21 PM
Modified: Oct 7, 2018 9:01 PM
Views: 7
Tags: no tags
  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 gui;
  7.  
  8. import java.sql.Connection;
  9.  
  10. /**
  11.  *
  12.  * @author Sidney
  13.  */
  14. public class Menu extends javax.swing.JFrame {
  15.  
  16.     Connection con;
  17.  
  18.     public Menu(Connection con) {
  19.         initComponents();
  20.         this.con = con;
  21.     }
  22.  
  23.     public Menu() {
  24.         initComponents();
  25.     }
  26.  
  27.     /**
  28.      * This method is called from within the constructor to initialize the form.
  29.      * WARNING: Do NOT modify this code. The content of this method is always
  30.      * regenerated by the Form Editor.
  31.      */
  32.     @SuppressWarnings("unchecked")
  33.     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  34.     private void initComponents() {
  35.  
  36.         jMenuBar1 = new javax.swing.JMenuBar();
  37.         jMenu1 = new javax.swing.JMenu();
  38.         jMenu2 = new javax.swing.JMenu();
  39.  
  40.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  41.  
  42.         jMenu1.setText("File");
  43.         jMenuBar1.add(jMenu1);
  44.  
  45.         jMenu2.setText("Edit");
  46.         jMenuBar1.add(jMenu2);
  47.  
  48.         setJMenuBar(jMenuBar1);
  49.  
  50.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  51.         getContentPane().setLayout(layout);
  52.         layout.setHorizontalGroup(
  53.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  54.             .addGap(0, 400, Short.MAX_VALUE)
  55.         );
  56.         layout.setVerticalGroup(
  57.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  58.             .addGap(0, 279, Short.MAX_VALUE)
  59.         );
  60.  
  61.         pack();
  62.     }// </editor-fold>                        
  63.  
  64.     /**
  65.      * @param args the command line arguments
  66.      */
  67.     public static void main(String args[]) {
  68.         /* Set the Nimbus look and feel */
  69.         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  70.         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  71.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  72.          */
  73.         try {
  74.             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  75.                 if ("Nimbus".equals(info.getName())) {
  76.                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
  77.                     break;
  78.                 }
  79.             }
  80.         } catch (ClassNotFoundException ex) {
  81.             java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  82.         } catch (InstantiationException ex) {
  83.             java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  84.         } catch (IllegalAccessException ex) {
  85.             java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  86.         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  87.             java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  88.         }
  89.         //</editor-fold>
  90.  
  91.         /* Create and display the form */
  92.         java.awt.EventQueue.invokeLater(new Runnable() {
  93.             public void run() {
  94.                 new Menu().setVisible(true);
  95.             }
  96.         });
  97.     }
  98.  
  99.     // Variables declaration - do not modify                    
  100.     private javax.swing.JMenu jMenu1;
  101.     private javax.swing.JMenu jMenu2;
  102.     private javax.swing.JMenuBar jMenuBar1;
  103.     // End of variables declaration                  
  104. }
  105.