Selasa, 04 November 2014

UTS Coding_"TOKO PAKAIAN"


Penjelasan Program Applikasi :
Applikasi yang saya buat sekarang tentang daftar harga penjualan di suatu toko pakaian yang bernama Widi's Fashion. Didalam applikasi ini terdapat nama pembeli, kode barang, harga barang, dan total harga dari pembelian barang tersebut.



CODING :

 private void formWindowActivated(java.awt.event.WindowEvent evt) {                                     
        // TODO add your handling code here:
        for(int i = 1;i<=31;i++){
            CTanggal.addItem(i);
        }
private void BProsesActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        int harga=Integer.parseInt(VHarga.getText());
        int jumlah=Integer.parseInt(VJumlah.getText());
        int TOTAL=harga*jumlah;
        VTOTAL.setText(""+TOTAL);

private void CKodeActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        if(CKode.getSelectedItem()=="1101"){
            VPakaian.setText("Blouse");
        }       
        else if(CKode.getSelectedItem()=="1102"){
            VPakaian.setText("Dress");
        }
        else if(CKode.getSelectedItem()=="1103"){
            VPakaian.setText("T-Shirt");
        }
        else if(CKode.getSelectedItem()=="1104"){
            VPakaian.setText("Kemeja");
        }
        else if(CKode.getSelectedItem()=="1105"){
            VPakaian.setText("Jaket dan Blazer");
        }
        else if(CKode.getSelectedItem()=="1106"){
            VPakaian.setText("Cardigan");
        }
        else if(CKode.getSelectedItem()=="1107"){
            VPakaian.setText("Sweater");
        }
        else if(CKode.getSelectedItem()=="1108"){
            VPakaian.setText("Vest dan Rompi");
        }
        else if(CKode.getSelectedItem()=="1109"){
            VPakaian.setText("Tank Top");
        }
        else if(CKode.getSelectedItem()=="1110"){
            VPakaian.setText("Bolero");
        }
    }                                     

 private void BClearActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
        VNPembeli.setText("");
        VPakaian.setText("");
        VHarga.setText("");
        VJumlah.setText("");
        VTOTAL.setText("");
    }                                      

    private void BSaveActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        System.exit(WIDTH);
    }                                     

HASIL RUN :


Tidak ada komentar:

Posting Komentar