|
| 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 | +/** |
| 9 | + * |
| 10 | + * @author arastoo |
| 11 | + */ |
| 12 | +public class Dashboard extends javax.swing.JFrame { |
| 13 | + |
| 14 | + /** |
| 15 | + * Creates new form Dashboard |
| 16 | + */ |
| 17 | + public Dashboard() { |
| 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">//GEN-BEGIN:initComponents |
| 28 | + private void initComponents() { |
| 29 | + |
| 30 | + jLabel1 = new javax.swing.JLabel(); |
| 31 | + MainMenuButton = new javax.swing.JButton(); |
| 32 | + |
| 33 | + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
| 34 | + setResizable(false); |
| 35 | + |
| 36 | + jLabel1.setText("Hello Friend"); |
| 37 | + |
| 38 | + MainMenuButton.setText("Go to main menu"); |
| 39 | + MainMenuButton.addActionListener(new java.awt.event.ActionListener() { |
| 40 | + public void actionPerformed(java.awt.event.ActionEvent evt) { |
| 41 | + MainMenuButtonActionPerformed(evt); |
| 42 | + } |
| 43 | + }); |
| 44 | + |
| 45 | + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); |
| 46 | + getContentPane().setLayout(layout); |
| 47 | + layout.setHorizontalGroup( |
| 48 | + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
| 49 | + .addGroup(layout.createSequentialGroup() |
| 50 | + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
| 51 | + .addGroup(layout.createSequentialGroup() |
| 52 | + .addGap(168, 168, 168) |
| 53 | + .addComponent(jLabel1)) |
| 54 | + .addGroup(layout.createSequentialGroup() |
| 55 | + .addGap(136, 136, 136) |
| 56 | + .addComponent(MainMenuButton))) |
| 57 | + .addContainerGap(151, Short.MAX_VALUE)) |
| 58 | + ); |
| 59 | + layout.setVerticalGroup( |
| 60 | + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
| 61 | + .addGroup(layout.createSequentialGroup() |
| 62 | + .addGap(120, 120, 120) |
| 63 | + .addComponent(jLabel1) |
| 64 | + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 81, Short.MAX_VALUE) |
| 65 | + .addComponent(MainMenuButton) |
| 66 | + .addGap(62, 62, 62)) |
| 67 | + ); |
| 68 | + |
| 69 | + pack(); |
| 70 | + }// </editor-fold>//GEN-END:initComponents |
| 71 | + |
| 72 | + private void MainMenuButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MainMenuButtonActionPerformed |
| 73 | + this.dispose(); |
| 74 | + MainMenu mainmenu = new MainMenu(); |
| 75 | + mainmenu.setVisible(true); |
| 76 | + }//GEN-LAST:event_MainMenuButtonActionPerformed |
| 77 | + |
| 78 | + /** |
| 79 | + * @param args the command line arguments |
| 80 | + */ |
| 81 | + public static void main(String args[]) { |
| 82 | + /* Set the Nimbus look and feel */ |
| 83 | + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> |
| 84 | + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. |
| 85 | + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html |
| 86 | + */ |
| 87 | + try { |
| 88 | + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { |
| 89 | + if ("Nimbus".equals(info.getName())) { |
| 90 | + javax.swing.UIManager.setLookAndFeel(info.getClassName()); |
| 91 | + break; |
| 92 | + } |
| 93 | + } |
| 94 | + } catch (ClassNotFoundException ex) { |
| 95 | + java.util.logging.Logger.getLogger(Dashboard.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); |
| 96 | + } catch (InstantiationException ex) { |
| 97 | + java.util.logging.Logger.getLogger(Dashboard.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); |
| 98 | + } catch (IllegalAccessException ex) { |
| 99 | + java.util.logging.Logger.getLogger(Dashboard.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); |
| 100 | + } catch (javax.swing.UnsupportedLookAndFeelException ex) { |
| 101 | + java.util.logging.Logger.getLogger(Dashboard.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); |
| 102 | + } |
| 103 | + //</editor-fold> |
| 104 | + |
| 105 | + /* Create and display the form */ |
| 106 | + java.awt.EventQueue.invokeLater(new Runnable() { |
| 107 | + public void run() { |
| 108 | + new Dashboard().setVisible(true); |
| 109 | + } |
| 110 | + }); |
| 111 | + } |
| 112 | + |
| 113 | + // Variables declaration - do not modify//GEN-BEGIN:variables |
| 114 | + private javax.swing.JButton MainMenuButton; |
| 115 | + private javax.swing.JLabel jLabel1; |
| 116 | + // End of variables declaration//GEN-END:variables |
| 117 | +} |
0 commit comments