Tuesday, May 9, 2017

hai teman-teman.. ketemu lagi d blog saya...
saya akan sedikit berbagi cara membuat projec penjualan, Toko Elektronik Sitanggang,
menggunakan aplikasi NETBeansIDE.

Program ini melanjutkan program yang sebelumnya,
disini saya hanya menambahkan
JButton di menu Cetak.
berikut source nya dan screenshoot tampilannya


 */
public class UTSJFRAME extends javax.swing.JFrame {

int tv,dvd,sound,radio,microfon,antena;
int total,ttv,tdvd,jumlahbelanja,tsound,tradio,tmicrofon,tantena;
    /**
     * Creates new form UTSJFRAME
     */
    public UTSJFRAME() {
        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() {

        jLabel9 = new javax.swing.JLabel();
        jTextField6 = new javax.swing.JTextField();
        Judul = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        kasir = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        JumlahTV = new javax.swing.JTextField();
        JumlahDVD = new javax.swing.JTextField();
        JumlahSound = new javax.swing.JTextField();
        JumlahRadio = new javax.swing.JTextField();
        JumlahMicrofon = new javax.swing.JTextField();
        JumlahAntena = new javax.swing.JTextField();
        HTV = new javax.swing.JTextField();
        HDVD = new javax.swing.JTextField();
        HSOUND = new javax.swing.JTextField();
        HRADIO = new javax.swing.JTextField();
        HMICROFON = new javax.swing.JTextField();
        HANTENA = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        TOTALBAYAR = new javax.swing.JTextField();
        Diskon = new javax.swing.JRadioButton();
        CARD = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        TotalItem = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        nik = new javax.swing.JComboBox<>();
        voucher = new javax.swing.JComboBox<>();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        Text1 = new javax.swing.JTextArea();
        cetak = new javax.swing.JButton();

        jLabel9.setText("jLabel9");

        jTextField6.setText("jTextField6");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        Judul.setText("TOKO ELEKTRONIC SITANGGANG");

        jLabel2.setText("KASIR:");

        jLabel3.setText("NIK    :");

        jLabel4.setText("TV");

        jLabel5.setText("DVD");

        jLabel6.setText("SOUND SYSTEM");

        jLabel7.setText("RADIO TAPE");

        jLabel8.setText("MICROFON");

        jLabel10.setText("ANTENA");

        jLabel11.setText("Nama Barang");

        jLabel12.setText("Jumlah");

        jLabel13.setText("Rupiah");

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

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

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

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

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

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

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

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

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

        jLabel14.setText("Total Bayar :");

        jLabel15.setText("Pembayaran :");

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

        Diskon.setText("Disc 20%");
        Diskon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DiskonActionPerformed(evt);
            }
        });

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

        jLabel16.setText("Jumlah Belanja");

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

        jButton1.setText("CASH");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        nik.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Pilih", "161011400046", "161011400064", "161011400066" }));
        nik.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nikActionPerformed(evt);
            }
        });

        voucher.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Voucher", "V1", "V2", "V3" }));
        voucher.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                voucherActionPerformed(evt);
            }
        });

        jLabel17.setText("*) CARD mendapat potongan 10%");

        jLabel18.setText("*) V1 mendapat potongan senilai Rp. 20.000");

        jLabel19.setText("*) V2 mendapat potongan senilai Rp. 50.000");

        jLabel20.setText("*) V3 mendapat potongan senilai Rp. 100.000");

        Text1.setColumns(20);
        Text1.setRows(5);
        jScrollPane1.setViewportView(Text1);

        cetak.setText("Cetak");
        cetak.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cetakActionPerformed(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()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(kasir, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JumlahTV, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JumlahDVD, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JumlahSound, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JumlahRadio, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JumlahMicrofon, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JumlahAntena, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(28, 28, 28)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(HTV, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(HDVD, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(HSOUND, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(HRADIO, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(HMICROFON, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(HANTENA, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(20, 20, 20)
                                        .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addGap(39, 39, 39)
                                        .addComponent(jLabel15)))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(TotalItem, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(Diskon, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(4, 4, 4)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel17)
                                            .addComponent(jLabel18)
                                            .addComponent(jLabel19)
                                            .addComponent(jLabel20)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jButton1)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(CARD)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(voucher, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(cetak))))))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(273, 273, 273)
                                .addComponent(jLabel14)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(TOTALBAYAR, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(134, 134, 134)
                                .addComponent(Judul))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(65, 65, 65)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(nik, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(Judul)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(nik, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(kasir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(30, 30, 30)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel12)
                        .addComponent(jLabel13)))
                .addGap(22, 22, 22)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(JumlahTV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(HTV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(2, 2, 2)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(JumlahDVD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(HDVD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel6)
                                .addComponent(JumlahSound, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(HSOUND, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(JumlahRadio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(HRADIO, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(27, 27, 27)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8)
                            .addComponent(HMICROFON, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JumlahMicrofon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(JumlahAntena, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(18, 18, 18)
                                        .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(50, 50, 50))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(HANTENA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(Diskon)
                            .addComponent(TotalItem, 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(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(TOTALBAYAR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(CARD)
                    .addComponent(jLabel15)
                    .addComponent(jButton1)
                    .addComponent(voucher, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cetak))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel17)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel18)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel20)
                .addGap(35, 35, 35))
        );

        pack();
    }// </editor-fold>                       
public void cetak(){
    int p = JOptionPane.showConfirmDialog(null,"Ingin Cetak ?","Informasi",JOptionPane.YES_NO_OPTION);
    if(p==0){
    Text1.setText("Nama Barang : "+"\n--TV--"+"\nJumlah Barang : "+ttv+"\nHarga Barang : "+tv+"\n--DVD--"+"Jumlah Barang : "+tdvd+"\nHarga Barang : "+dvd+
            "\n--Sound System--"+"\nJumlah Barang : "+tsound+"\nHarga Barang : "+sound+"\n--Radio Tape--"+"\nJumlah Barang : "+tradio+
            "\nHarga Barang : "+radio+"\n--Microfon--"+"\nJumlah Barang : "+tmicrofon+"\nHarga Barang : "+microfon+
            "\n--Antena--"+"\nJumlah Barang : "+tantena+"\nHarga Barang : "+antena+"\nJumlah Harga : "+total+
            "\nTotal Bayar : "+total);   
    }
   
}
    private void JumlahRadioActionPerformed(java.awt.event.ActionEvent evt) {                                           
        // TODO add your handling code here:
        tradio = Integer.parseInt(JumlahRadio.getText());
        radio = tradio * 1500000;
        HRADIO.setText(""+radio);
       
    }                                          

    private void JumlahAntenaActionPerformed(java.awt.event.ActionEvent evt) {                                            
        // TODO add your handling code here:
        tantena = Integer.parseInt(JumlahAntena.getText());
        antena = tantena * 500000;
        HANTENA.setText(""+antena);
    }                                           

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

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

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

    private void CARDActionPerformed(java.awt.event.ActionEvent evt) {                                    
        // TODO add your handling code here:
       int card, hcard,tcard;
       card = Integer.parseInt(TOTALBAYAR.getText());
       hcard = card / 20;
       tcard = card - hcard;
        TOTALBAYAR.setText(""+tcard);
           
       
    }                                   

    private void JumlahTVActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        ttv = Integer.parseInt(JumlahTV.getText());     
        tv = ttv * 4000000;
        HTV.setText(""+tv);
    }                                       

    private void JumlahDVDActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        tdvd = Integer.parseInt(JumlahDVD.getText());
        dvd = tdvd * 2000000;
        HDVD.setText(""+dvd);
    }                                        

    private void JumlahSoundActionPerformed(java.awt.event.ActionEvent evt) {                                           
        // TODO add your handling code here:
        tsound = Integer.parseInt(JumlahSound.getText());
        sound = tsound * 2500000;
        HSOUND.setText(""+sound);
    }                                          

    private void JumlahMicrofonActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
        tmicrofon = Integer.parseInt(JumlahMicrofon.getText());
        microfon = tmicrofon * 1000000;
        HMICROFON.setText(""+microfon);
    }                                             

    private void TOTALBAYARActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
        total = tv+dvd+sound+radio+microfon+antena;
       
        TOTALBAYAR.setText(""+total);
    }                                         

    private void DiskonActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        if (Diskon.isSelected()){
            int diskon, hdiskon;
            diskon = total*20/100;
            hdiskon = total - diskon;
            TOTALBAYAR.setText("" + hdiskon);
        }else {
            TOTALBAYAR.setText(""+total);
        }
   
    }                                     

    private void TotalItemActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        int jumlahbelanja;
        jumlahbelanja = ttv+tdvd+tsound+tradio+tmicrofon+tantena;
       
        TotalItem.setText("" + jumlahbelanja);
    }                                        

    private void nikActionPerformed(java.awt.event.ActionEvent evt) {                                   
        // TODO add your handling code here:
        if(nik.getSelectedItem()=="Pilih"){
            kasir.setText("");
        }
        else if(nik.getSelectedItem()=="161011400046"){
            kasir.setText("Herlinda Mita M. Sitanggang");
        }
        else if(nik.getSelectedItem()=="161011400064"){
            kasir.setText("Yuli Christiani Sitanggang");
        }
        else if(nik.getSelectedItem()=="161011400066"){
            kasir.setText("Jhon M.A Sitanggang");
        }
    }                                  

    private void voucherActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
        int jumlah1, jumlah2, jumlah3;
        if (voucher.getSelectedItem()=="Voucher"){
            TOTALBAYAR.setText(""+total);
        }
        if (voucher.getSelectedItem()=="V1"){
            jumlah1=total-20000;
            TOTALBAYAR.setText(""+jumlah1);
        }
        if (voucher.getSelectedItem()=="V2"){
            jumlah2=total-50000;
            TOTALBAYAR.setText(""+jumlah2);
        }
        if (voucher.getSelectedItem()=="V3"){
            jumlah3=total-100000;
            TOTALBAYAR.setText(""+jumlah3);
        }
    }                                      

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        total = tv+dvd+sound+radio+microfon+antena;
       
        TOTALBAYAR.setText(""+total);
    }                                       

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

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

    // Variables declaration - do not modify                    
    private javax.swing.JButton CARD;
    private javax.swing.JRadioButton Diskon;
    private javax.swing.JTextField HANTENA;
    private javax.swing.JTextField HDVD;
    private javax.swing.JTextField HMICROFON;
    private javax.swing.JTextField HRADIO;
    private javax.swing.JTextField HSOUND;
    private javax.swing.JTextField HTV;
    private javax.swing.JLabel Judul;
    private javax.swing.JTextField JumlahAntena;
    private javax.swing.JTextField JumlahDVD;
    private javax.swing.JTextField JumlahMicrofon;
    private javax.swing.JTextField JumlahRadio;
    private javax.swing.JTextField JumlahSound;
    private javax.swing.JTextField JumlahTV;
    private javax.swing.JTextField TOTALBAYAR;
    private javax.swing.JTextArea Text1;
    private javax.swing.JTextField TotalItem;
    private javax.swing.JButton cetak;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    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.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField kasir;
    private javax.swing.JComboBox<String> nik;
    private javax.swing.JComboBox<String> voucher;
    // End of variables declaration                  
}




teimakasih teman-teman, saya akan menantikan dan menghargai kritik dan sarannya..
tengkiu...