×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Alexandros Kyriazis
Added: Jan 25, 2022 6:46 PM
Views: 399
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 semesterprojectv5;
  7.  
  8. /**
  9.  *
  10.  * @author alexa
  11.  */
  12. public class Start extends javax.swing.JFrame {
  13.  
  14.     /**
  15.      * Creates new form Start
  16.      */
  17.     public Start() {
  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.         jMenuItem2 = new javax.swing.JMenuItem();
  31.         jLabel1 = new javax.swing.JLabel();
  32.         jMenuBar1 = new javax.swing.JMenuBar();
  33.         jMenu1 = new javax.swing.JMenu();
  34.         jMenuItem1 = new javax.swing.JMenuItem();
  35.         jMenuItem3 = new javax.swing.JMenuItem();
  36.         jMenu2 = new javax.swing.JMenu();
  37.         jMenuItem4 = new javax.swing.JMenuItem();
  38.  
  39.         jMenuItem2.setText("jMenuItem2");
  40.  
  41.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  42.  
  43.         jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
  44.         jLabel1.setText("Covid Data Analyzer");
  45.  
  46.         jMenu1.setText("Options");
  47.  
  48.         jMenuItem1.setText("Data Manager");
  49.         jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
  50.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  51.                 jMenuItem1ActionPerformed(evt);
  52.             }
  53.         });
  54.         jMenu1.add(jMenuItem1);
  55.  
  56.         jMenuItem3.setText("Show Data");
  57.         jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
  58.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  59.                 jMenuItem3ActionPerformed(evt);
  60.             }
  61.         });
  62.         jMenu1.add(jMenuItem3);
  63.  
  64.         jMenuBar1.add(jMenu1);
  65.  
  66.         jMenu2.setText("Exit");
  67.  
  68.         jMenuItem4.setText("Exit");
  69.         jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
  70.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  71.                 jMenuItem4ActionPerformed(evt);
  72.             }
  73.         });
  74.         jMenu2.add(jMenuItem4);
  75.  
  76.         jMenuBar1.add(jMenu2);
  77.  
  78.         setJMenuBar(jMenuBar1);
  79.  
  80.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  81.         getContentPane().setLayout(layout);
  82.         layout.setHorizontalGroup(
  83.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  84.             .addGroup(layout.createSequentialGroup()
  85.                 .addGap(132, 132, 132)
  86.                 .addComponent(jLabel1)
  87.                 .addContainerGap(149, Short.MAX_VALUE))
  88.         );
  89.         layout.setVerticalGroup(
  90.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  91.             .addGroup(layout.createSequentialGroup()
  92.                 .addGap(118, 118, 118)
  93.                 .addComponent(jLabel1)
  94.                 .addContainerGap(161, Short.MAX_VALUE))
  95.         );
  96.  
  97.         pack();
  98.     }// </editor-fold>                        
  99.  
  100.     private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {                                          
  101.         new Datamanager().setVisible(true);
  102.     }                                          
  103.  
  104.     private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {                                          
  105.         // TODO add your handling code here:
  106.         System.exit(0);
  107.     }                                          
  108.  
  109.     private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {                                          
  110.         new Showdata().setVisible(true);
  111.     }                                          
  112.  
  113.     /**
  114.      * @param args the command line arguments
  115.      */
  116.     public static void main(String args[]) {
  117.         /* Set the Nimbus look and feel */
  118.         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  119.         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  120.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  121.          */
  122.         try {
  123.             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  124.                 if ("Nimbus".equals(info.getName())) {
  125.                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
  126.                     break;
  127.                 }
  128.             }
  129.         } catch (ClassNotFoundException ex) {
  130.             java.util.logging.Logger.getLogger(Start.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  131.         } catch (InstantiationException ex) {
  132.             java.util.logging.Logger.getLogger(Start.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  133.         } catch (IllegalAccessException ex) {
  134.             java.util.logging.Logger.getLogger(Start.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  135.         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  136.             java.util.logging.Logger.getLogger(Start.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  137.         }
  138.         //</editor-fold>
  139.  
  140.         /* Create and display the form */
  141.         java.awt.EventQueue.invokeLater(new Runnable() {
  142.             public void run() {
  143.                 new Start().setVisible(true);
  144.             }
  145.         });
  146.     }
  147.  
  148.     // Variables declaration - do not modify                    
  149.     private javax.swing.JLabel jLabel1;
  150.     private javax.swing.JMenu jMenu1;
  151.     private javax.swing.JMenu jMenu2;
  152.     private javax.swing.JMenuBar jMenuBar1;
  153.     private javax.swing.JMenuItem jMenuItem1;
  154.     private javax.swing.JMenuItem jMenuItem2;
  155.     private javax.swing.JMenuItem jMenuItem3;
  156.     private javax.swing.JMenuItem jMenuItem4;
  157.     // End of variables declaration                  
  158. }
  159.