Program Pemesanan Tiket Bioskop

 Selasa, 26 Juni 2018

Program Pemesanan Tiket Bioskop


1. Penjelasan Program

“Pemesanan Tiket Bioskop secara Online”. Saat ini, sudah banyak orang-orang yang sering menghabiskan waktunya hanya untuk menonton film di bioskop. Entah itu menonton bersama keluarga, sahabat, pacar atau bahkan hanya sendirian saja. Ditambah lagi dengan adanya film-film terbaru yang sangat merekomendasikan Anda untuk menonton film tersebut, sehingga membuat Anda selalu tertarik untuk datang ke bioskop. Namun, bertempat tinggal di DKI Jakarta terkadang membuat kita selalu bertemu dengan keadaan ‘terlambat untuk sampai tujuan’ dikarenakan lalu lintas yang padat alias macet. Maka dari itu, saya membuat project ini dengan tujuan; jika Anda tidak sempat waktu untuk membeli tiket secara langsung dikarenakan terjebak macet. Maka, Anda dapat memesan tiket terlebih dahulu melalui media online yang sudah disediakan. Jadi , Anda tidak perlu khawatir akan kehabisan tiket.

2. Saya ingin menampilkan hasil output-nya ketika di run akan terlihat seperti pada gambar dibawah ini.


 


 


3. Source Code

package utsfauzi;

/**
 *
 * @author fauzi
 */
public class Fauzi extends javax.swing.JFrame {

    /**
     * Creates new form Fauzi
     */
    public Fauzi() {
        initComponents();
    }

    /**
     * This method is called fsrom 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() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        notiket = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        reguler = new javax.swing.JRadioButton();
        ultraXD = new javax.swing.JRadioButton();
        Junior = new javax.swing.JRadioButton();
        gold = new javax.swing.JRadioButton();
        jLabel4 = new javax.swing.JLabel();
        hargasatuan = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jumlahbeli = new javax.swing.JTextField();
        btnProses = new javax.swing.JButton();
        btnHapus = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        totalbayar = new javax.swing.JTextField();
        jComboBox1 = new javax.swing.JComboBox<>();
        jLabel7 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        jLabel1.setText("Loket Tiket Bioskop XXI");

        jLabel2.setText("No Tiket");

        notiket.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                notiketActionPerformed(evt);
            }
        });

        jLabel3.setText("Jenis Tiket");

        reguler.setText("reguler");
        reguler.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                regulerActionPerformed(evt);
            }
        });

        ultraXD.setText("ultra XD");
        ultraXD.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ultraXDActionPerformed(evt);
            }
        });

        Junior.setText("Junior");
        Junior.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JuniorActionPerformed(evt);
            }
        });

        gold.setText("gold");
        gold.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                goldActionPerformed(evt);
            }
        });

        jLabel4.setText("Harga Satuan");

        hargasatuan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                hargasatuanActionPerformed(evt);
            }
        });

        jLabel5.setText("Jumlah Beli");

        jumlahbeli.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jumlahbeliActionPerformed(evt);
            }
        });

        btnProses.setText("Proses");
        btnProses.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProsesActionPerformed(evt);
            }
        });

        btnHapus.setText("Hapus");
        btnHapus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHapusActionPerformed(evt);
            }
        });

        jLabel6.setText("Total Bayar");

        totalbayar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                totalbayarActionPerformed(evt);
            }
        });

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { " ", "Rom: A Seat ,10", "Rom: B Seat ,11", "Rom: C Seat ,12", "Rom: D Seat ,13" }));
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        jLabel7.setText("Nomer Kursi");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(jLabel6)
                    .addComponent(jLabel5)
                    .addComponent(jLabel7))
                .addGap(26, 26, 26)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(notiket)
                    .addComponent(hargasatuan)
                    .addComponent(jumlahbeli)
                    .addComponent(totalbayar)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(reguler, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(Junior, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ultraXD, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(gold, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(0, 66, Short.MAX_VALUE)))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(btnProses)
                        .addGap(18, 18, 18)
                        .addComponent(btnHapus)
                        .addGap(38, 38, 38))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(107, 107, 107))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(43, 43, 43)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(notiket, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(reguler)
                    .addComponent(ultraXD))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Junior)
                    .addComponent(gold))
                .addGap(26, 26, 26)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addGap(17, 17, 17)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(hargasatuan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jumlahbeli, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnProses)
                    .addComponent(btnHapus))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(totalbayar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addContainerGap(46, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>                       

    private void regulerActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
        hargasatuan.setText("50000");
    }                                      

    private void ultraXDActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
        hargasatuan.setText("75000");      
    }                                      

    private void JuniorActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        hargasatuan.setText("150000");
    }                                     

    private void goldActionPerformed(java.awt.event.ActionEvent evt) {                                    
        // TODO add your handling code here:
        hargasatuan.setText("250000");
    }                                   

    private void btnProsesActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        int c = Integer.parseInt(hargasatuan.getText());
        int d = Integer.parseInt(jumlahbeli.getText());
        int hasilnya = c*d;
        totalbayar.setText("Rp.   "+hasilnya);
    }                                        

    private void btnHapusActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        notiket.setText("");
        jumlahbeli.setText("");
        hargasatuan.setText("");
        totalbayar.setText("");
        reguler.setSelected(false);
        ultraXD.setSelected(false);
        reguler.setEnabled(true);
        ultraXD.setEnabled(true);
    }                                       

    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
    }                                         

    private void hargasatuanActionPerformed(java.awt.event.ActionEvent evt) {                                           
        // TODO add your handling code here:
    }                                          

    private void jumlahbeliActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
    }                                         

    private void notiketActionPerformed(java.awt.event.ActionEvent evt) {                                       
         // TODO add your handling code here:
    }                                      

    private void totalbayarActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
    }                                         

    /**
     * @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(Fauzi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Fauzi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Fauzi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Fauzi.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 Fauzi().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                    
    private javax.swing.JRadioButton Junior;
    private javax.swing.JButton btnHapus;
    private javax.swing.JButton btnProses;
    private javax.swing.JRadioButton gold;
    private javax.swing.JTextField hargasatuan;
    private javax.swing.JComboBox<String> jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JTextField jumlahbeli;
    private javax.swing.JTextField notiket;
    private javax.swing.JRadioButton reguler;
    private javax.swing.JTextField totalbayar;
    private javax.swing.JRadioButton ultraXD;
    // End of variables declaration                  
}

Komentar