Sabtu, 22 Juli 2017

PEMOGRAMAN APLIKASI PEMESANAN LAPANGAN FUTSAL

     
DESKRIPSI

          Program aplikasi booking lapangan futsal dibuat dikarenakan menjamurnya lapangan futsal, disetiap daerah-daerah terutama di kota-kota besar, betapa tingginya animo masyarakat terhadap olahraga futsal. disini saya membuat program untuk memudahkan booking/pemesanaan lapangan futsal . untuk memudahkan para pengguna/pemesan lapangan supaya lebih cepat dan efisien.
          Dengan berkembangnya teknologi dan kebutuhan informasi, menyebabkan semakin kompleksnya informasi yang harus bisa diolah.sehingga kebutuhan pengguna akan jaringan komputer secara meneyeluruh semakin diperlukan.

         Komponen Variabel 
- Nama pemesan
- lama main
- harga perjam
- jumlah bayar
- total bayar

Rumus Variabel 
 - text label 
- text field
- radio buttom
- buttom

















CODINGAN


public class Frame_Futsal extends javax.swing.JFrame {

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

    /**
     * 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() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        HargaPerjam = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        SatuJam = new javax.swing.JRadioButton();
        DuaJam = new javax.swing.JRadioButton();
        TigaJam = new javax.swing.JRadioButton();
        EmpatJam = new javax.swing.JRadioButton();
        jLabel6 = new javax.swing.JLabel();
        TotalBayar = new javax.swing.JTextField();
        Pesan = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("Booking Futsal");

        jLabel2.setText("Lama Main");

        jLabel3.setText("Harga Perjam");

        SatuJam.setText("1 Jam");
        SatuJam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SatuJamActionPerformed(evt);
            }
        });

        DuaJam.setText("2 Jam");
        DuaJam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DuaJamActionPerformed(evt);
            }
        });

        TigaJam.setText("3 Jam");
        TigaJam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TigaJamActionPerformed(evt);
            }
        });

        EmpatJam.setText("4 Jam");
        EmpatJam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EmpatJamActionPerformed(evt);
            }
        });

        jLabel6.setText("Total Bayar");

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

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

        jLabel4.setText("Nama Pemesan");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(186, 186, 186)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel3)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel6)
                                    .addComponent(jLabel4))
                                .addGap(78, 78, 78)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(SatuJam)
                                        .addGap(18, 18, 18)
                                        .addComponent(TigaJam))
                                    .addComponent(HargaPerjam, javax.swing.GroupLayout.DEFAULT_SIZE, 227, Short.MAX_VALUE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(DuaJam)
                                        .addGap(18, 18, 18)
                                        .addComponent(EmpatJam))
                                    .addComponent(TotalBayar, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(Pesan)
                                    .addComponent(jTextField1))))))
                .addContainerGap(121, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addComponent(jLabel1)
                .addGap(29, 29, 29)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel4)
                    .addComponent(jTextField1, 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.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(42, 42, 42)
                        .addComponent(jLabel3))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(SatuJam)
                            .addComponent(TigaJam))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(DuaJam)
                            .addComponent(EmpatJam))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(HargaPerjam, 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(TotalBayar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addGap(18, 18, 18)
                .addComponent(Pesan)
                .addContainerGap(192, Short.MAX_VALUE))
        );

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

    private void SatuJamActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
        HargaPerjam.setText("20000");
    }                                      

    private void DuaJamActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        HargaPerjam.setText("40000");
    }                                     

    private void TigaJamActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
        HargaPerjam.setText("60000");
    }                                      

    private void EmpatJamActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        HargaPerjam.setText("80000");
    }                                       

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

    private void PesanActionPerformed(java.awt.event.ActionEvent evt) {                                     
        // TODO add your handling code here:
        int a= Integer.parseInt(HargaPerjam.getText());
            TotalBayar.setText("Rp. "+a);
    }                                    

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

    // Variables declaration - do not modify                    
    private javax.swing.JRadioButton DuaJam;
    private javax.swing.JRadioButton EmpatJam;
    private javax.swing.JTextField HargaPerjam;
    private javax.swing.JButton Pesan;
    private javax.swing.JRadioButton SatuJam;
    private javax.swing.JRadioButton TigaJam;
    private javax.swing.JTextField TotalBayar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JTextField jTextField1;
    // End of variables declaration                  
}