Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package ticketing;
- import javax.swing.JFrame;
- import javax.swing.JOptionPane;
- /**
- *
- * @author ta
- */
- public class Board extends javax.swing.JFrame {
- /**
- * Creates new form Board
- */
- public Board() {
- initComponents();
- this.setExtendedState(JFrame.MAXIMIZED_BOTH);
- }
- /**
- * This method is called from within the constructor to initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is always
- * regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- private void initComponents() {
- MenuBar = new javax.swing.JMenuBar();
- mSystem = new javax.swing.JMenu();
- itUser = new javax.swing.JMenuItem();
- itLogout = new javax.swing.JMenuItem();
- itExit = new javax.swing.JMenuItem();
- mMaster = new javax.swing.JMenu();
- itTicket = new javax.swing.JMenuItem();
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- MenuBar.setToolTipText("allMenu");
- mSystem.setText("System");
- mSystem.setToolTipText("system");
- itUser.setText("User");
- itUser.setToolTipText("user");
- itUser.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- itUserActionPerformed(evt);
- }
- });
- mSystem.add(itUser);
- itLogout.setText("Logout");
- itLogout.setToolTipText("logout");
- itLogout.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- itLogoutActionPerformed(evt);
- }
- });
- mSystem.add(itLogout);
- itExit.setText("Exit");
- itExit.setToolTipText("exit");
- itExit.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- itExitActionPerformed(evt);
- }
- });
- mSystem.add(itExit);
- MenuBar.add(mSystem);
- mMaster.setText("Master");
- mMaster.setToolTipText("master");
- itTicket.setText("Ticket");
- itTicket.setToolTipText("ticket");
- itTicket.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- itTicketActionPerformed(evt);
- }
- });
- mMaster.add(itTicket);
- MenuBar.add(mMaster);
- setJMenuBar(MenuBar);
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 400, Short.MAX_VALUE)
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 279, Short.MAX_VALUE)
- );
- pack();
- }// </editor-fold>
- private void itUserActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void itExitActionPerformed(java.awt.event.ActionEvent evt) {
- int result = JOptionPane.showConfirmDialog(this,
- "Apakah Anda akan keluar dari system?",
- "Keluar dari system", JOptionPane.YES_NO_OPTION);
- if (result == JOptionPane.YES_OPTION) System.exit(0);
- }
- private void itTicketActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void itLogoutActionPerformed(java.awt.event.ActionEvent evt) {
- Login Log = new Login();
- Log.setTitle("Login");
- Log.setVisible(true);
- this.dispose();
- }
- private void itLogoutActionPerformed(java.awt.event.ActionEvent){
- try{
- Login Log = new Login();
- Log.setTitle("Login");
- Log.setVisible(true);
- this.dispose();
- } catch (IOException ex){
- Logger.getLogger(Board.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- /**
- * @param args the command line arguments
- */
- public static void main(String args[]) {
- /* Set the Nimbus look and feel */
- //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- */
- try {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (ClassNotFoundException ex) {
- java.util.logging.Logger.getLogger(Board.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(Board.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(Board.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(Board.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //</editor-fold>
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new Board().setVisible(true);
- }
- });
- }
- // Variables declaration - do not modify
- private javax.swing.JMenuBar MenuBar;
- private javax.swing.JMenuItem itExit;
- private javax.swing.JMenuItem itLogout;
- private javax.swing.JMenuItem itTicket;
- private javax.swing.JMenuItem itUser;
- private javax.swing.JMenu mMaster;
- private javax.swing.JMenu mSystem;
- // End of variables declaration
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement