Selasa, 25 April 2017

Membuat Aplikasi Kasir Menggukan Java NeatBeans



/*
 * 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.
 */

/**
 *
 * @author user
 */
public class tokobaju extends javax.swing.JFrame {

    /**
     * Creates new form tokobaju
     */
    public tokobaju() {
        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() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        RBJAKET = new javax.swing.JRadioButton();
        buttonGroup1.add(RBJAKET);
        RBKAOS = new javax.swing.JRadioButton();
        buttonGroup1.add(RBKAOS);
        RBJILBAB = new javax.swing.JRadioButton();
        buttonGroup1.add(RBJILBAB);
        RBTAS = new javax.swing.JRadioButton();
        buttonGroup1.add(RBTAS);
        RBBATIK = new javax.swing.JRadioButton();
        buttonGroup1.add(RBBATIK);
        RBDOMPET = new javax.swing.JRadioButton();
        buttonGroup1.add(RBDOMPET);
        RBCELANA = new javax.swing.JRadioButton();
        buttonGroup1.add(RBCELANA);
        RBTOPI = new javax.swing.JRadioButton();
        buttonGroup1.add(RBTOPI);
        RBJAM = new javax.swing.JRadioButton();
        buttonGroup1.add(RBJAM);
        RBSEPATU = new javax.swing.JRadioButton();
        buttonGroup1.add(RBSEPATU);
        CB10 = new javax.swing.JCheckBox();
        TextHarga = new javax.swing.JTextField();
        TextDiskon = new javax.swing.JTextField();
        TextHasil = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        BtnHasil = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("DISTRO EVVA");

        RBJAKET.setText("JAKET");
        RBJAKET.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBJAKETActionPerformed(evt);
            }
        });

        RBKAOS.setText("KAOS");
        RBKAOS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBKAOSActionPerformed(evt);
            }
        });

        RBJILBAB.setText("JILBAB");
        RBJILBAB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBJILBABActionPerformed(evt);
            }
        });

        RBTAS.setText("TAS");
        RBTAS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBTASActionPerformed(evt);
            }
        });

        RBBATIK.setText("BATIK");
        RBBATIK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBBATIKActionPerformed(evt);
            }
        });

        RBDOMPET.setText("DOMPET");
        RBDOMPET.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBDOMPETActionPerformed(evt);
            }
        });

        RBCELANA.setText("CELANA");
        RBCELANA.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBCELANAActionPerformed(evt);
            }
        });

        RBTOPI.setText("TOPI");
        RBTOPI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBTOPIActionPerformed(evt);
            }
        });

        RBJAM.setText("JAM");
        RBJAM.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBJAMActionPerformed(evt);
            }
        });

        RBSEPATU.setText("SEPATU");
        RBSEPATU.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RBSEPATUActionPerformed(evt);
            }
        });

        CB10.setText("Diskon 10%");
        CB10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CB10ActionPerformed(evt);
            }
        });

        TextDiskon.setText("0");

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

        jLabel2.setText("Harga");

        jLabel3.setText("Diskon");

        BtnHasil.setText("Hasil");
        BtnHasil.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnHasilActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(RBJAKET)
                            .addComponent(RBKAOS, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(RBBATIK)
                            .addComponent(RBJILBAB)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel2)
                                .addComponent(RBCELANA)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(RBJAM)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(RBTAS, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(RBDOMPET)
                                    .addComponent(RBTOPI)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jLabel3)
                                        .addComponent(RBSEPATU)))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(80, 80, 80)
                                        .addComponent(CB10))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(67, 67, 67)
                                        .addComponent(BtnHasil)))))
                        .addGap(6, 6, 6))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(TextHarga, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(TextDiskon, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(TextHasil, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap(57, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addGap(129, 129, 129)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(RBTAS)
                    .addComponent(RBKAOS)
                    .addComponent(CB10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(RBDOMPET, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(RBCELANA))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(RBTOPI)
                    .addComponent(RBJAKET))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(RBJAM)
                    .addComponent(RBJILBAB, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(RBBATIK)
                    .addComponent(RBSEPATU))
                .addGap(37, 37, 37)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(BtnHasil))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TextDiskon)
                    .addComponent(TextHasil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextHarga))
                .addGap(40, 40, 40))
        );

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

    private void RBJAKETActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        TextHarga.setText(""+RBJAKET.getText());
        TextHarga.setText(""+250000);
     
    }                                      

    private void RBJILBABActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        TextHarga.setText(""+RBJILBAB.getText());
        TextHarga.setText(""+50000);
       
    }                                      

    private void RBBATIKActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        TextHarga.setText(""+RBBATIK.getText());
        TextHarga.setText(""+200000);
       
    }                                      

    private void RBKAOSActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        TextHarga.setText(""+RBKAOS.getText());
        TextHarga.setText(""+120000);
       
    }                                    

    private void RBCELANAActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        TextHarga.setText(""+RBCELANA.getText());
        TextHarga.setText(""+150000);
       
    }                                      

    private void RBTASActionPerformed(java.awt.event.ActionEvent evt) {                                    
        // TODO add your handling code here:
        TextHarga.setText(""+RBTAS.getText());
        TextHarga.setText(""+250000);
       
    }                                    

    private void RBDOMPETActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        TextHarga.setText(""+RBDOMPET.getText());
        TextHarga.setText(""+100000);
       

    }                                      

    private void RBTOPIActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        TextHarga.setText(""+RBTOPI.getText());
        TextHarga.setText(""+50000);
       
    }                                    

    private void RBJAMActionPerformed(java.awt.event.ActionEvent evt) {                                    
        // TODO add your handling code here:
        TextHarga.setText(""+RBJAM.getText());
        TextHarga.setText(""+50000);
       
    }                                    

    private void RBSEPATUActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        TextHarga.setText(""+RBSEPATU.getText());
        TextHarga.setText(""+200000);
       
    }                                      

    private void CB10ActionPerformed(java.awt.event.ActionEvent evt) {                                    
        // TODO add your handling code here:
        if(CB10.isSelected()){
            int harga=Integer.parseInt(TextHarga.getText());
            int Sepuluh=harga/10;
            TextDiskon.setText(""+Sepuluh);
        }else{
            TextDiskon.setText(""+0);
        }
    }                                  

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

    private void BtnHasilActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        int bil1=Integer.parseInt(TextHarga.getText());
        int bil2=Integer.parseInt(TextDiskon.getText());
        int hasil=bil1-bil2;
        TextHasil.setText(""+hasil);
    }                                      

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

    // Variables declaration - do not modify                    
    private javax.swing.JButton BtnHasil;
    private javax.swing.JCheckBox CB10;
    private javax.swing.JRadioButton RBBATIK;
    private javax.swing.JRadioButton RBCELANA;
    private javax.swing.JRadioButton RBDOMPET;
    private javax.swing.JRadioButton RBJAKET;
    private javax.swing.JRadioButton RBJAM;
    private javax.swing.JRadioButton RBJILBAB;
    private javax.swing.JRadioButton RBKAOS;
    private javax.swing.JRadioButton RBSEPATU;
    private javax.swing.JRadioButton RBTAS;
    private javax.swing.JRadioButton RBTOPI;
    private javax.swing.JTextField TextDiskon;
    private javax.swing.JTextField TextHarga;
    private javax.swing.JTextField TextHasil;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    // End of variables declaration                  
}

Membuat Database Di Ms. Acces Query

Assalamualaikum Wr. Wb. Untuk memenuhi tugas dari Mata Kuliah Audit IT Saya membuat database Laporan Inseminasi Dan PKB Pada Inseminas...