Jumat, 25 November 2011

MEMBUAT FORM GAJI

-Buka Netbeans > new project > ubah namanya jd PSS_Cikarang
-DiSource Package klik kanan > new >jframe form
-drag dari pallete Panel lalu ubah sesuai selera
-Untuk memberi warna klik diproperties > background
-Bentuk designnya




-Lalu ketik kodingnya
> Untuk class nya
public class PSS_Cikarang extends javax.swing.JFrame {
String nik,nama,jabatan,golongan;
int gapok,tunjangan,umakan,utransport,tunjanganhp,insentif,lembur,total,pphpasal21,jamsostek,koperasi,terima;
    /** Creates new form PSS_Cikarang */
    public PSS_Cikarang() {
        initComponents();
    }
  Untuk tombol keluar
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
// TODO add your handling code here:
    int x;
    x=JOptionPane.showConfirmDialog(null, "Anda Yakin Ingin keluar","Informasi",JOptionPane.YES_NO_OPTION);
    if(x==0);
    dispose();
}
Untuk Combo button NIK                                      
private void cmbnikActionPerformed(java.awt.event.ActionEvent evt) {                                      
// TODO add your handling code here:
    String nik;
    nik=cmbnik.getSelectedItem().toString();
    if(nik.equalsIgnoreCase("001"))
    {
        nik="001";
        nama="Nurjahjo";
        jabatan="Manager";
        gapok=8000000;
        tunjangan=800000;
        tunjanganhp=300000;
        insentif=500000;
    }
    else if(nik.equalsIgnoreCase("002"))
    {
        nik="002";
        nama="Rusdy";
        jabatan="Supervisor";
        gapok=5000000;
        tunjangan=700000;
        insentif=350000;
    }
    else if(nik.equalsIgnoreCase("003"))
    {
        nik="003";
        nama="Deden Herdiansyah";
        jabatan="Stockkeeper";
        gapok=1407000;
        tunjangan=500000;
        insentif=300000;
    }
    else if(nik.equalsIgnoreCase("004"))
    {
        nik="004";
        nama="Firmansyah";
        jabatan="Operator";
        gapok=1407000;
        tunjangan=350000;
        insentif=200000;
    }
    else if(nik.equalsIgnoreCase("005"))
    {
        nik="005";
        nama="Indra Yusuf";
        jabatan="Helper";
        gapok=1200000;
        tunjangan=250000;
        insentif=150000;
    }
    else if(nik.equalsIgnoreCase("006"))
    {
        nik="006";
        nama="Miharja";
        jabatan="Supervisor";
        gapok=5000000;
        tunjangan=700000;
        insentif=350000;
    }
    else if(nik.equalsIgnoreCase("007"))
    {
        nik="007";
        nama="Andy Irawan";
        jabatan="Stockkeeper";
        gapok=1407000;
        tunjangan=500000;
        insentif=300000;
    }
    else if(nik.equalsIgnoreCase("008"))
    {
        nik="008";
        nama="Sudryanto";
        jabatan="Operator";
        gapok=1407000;
        tunjangan=350000;
        insentif=200000;
    }
    else if(nik.equalsIgnoreCase("009"))
    {
        nik="009";
        nama="Yayat Nurhayat";
        jabatan="Helper";
        gapok=1200000;
        tunjangan=250000;
        insentif=150000;
    }
    txtnama.setText(nama);
    txtJab.setText(jabatan);
    txtGaji.setText(String.valueOf(gapok));
    txtTunjangan.setText(String.valueOf(tunjangan));
    txtTunhp.setText(String.valueOf(tunjanganhp));
  
}
Untuk Radio Button Tetap                                   
private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                             
// TODO add your handling code here:
    umakan=gapok*1/1000*22;
    utransport=gapok*2/1000*22;
  total=umakan+utransport+gapok+tunjangan+tunjanganhp+insentif;
  
    txtUmakan.setText(String.valueOf(umakan)); 
    txtUtransport.setText(String.valueOf(utransport));
    txtinsentif.setText(String.valueOf(insentif));
       txtTotal.setText(String.valueOf(total));
      
           
}                                            
Untuk Button Input
private void jbutton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
// TODO add your handling code here:
    cmbnik.setSelectedIndex(0);
    buttonGroup1.clearSelection();
    buttonGroup2.clearSelection();
    txtnama.setText("");
    txtJab.setText("");
    txtGaji.setText("");
    txtTunjangan.setText("");
    txtTunhp.setText("");
    txtUmakan.setText("");
    txtUtransport.setText("");
    txtinsentif.setText("");
    txtTotal.setText("");
    txtpph.setText("");
    txtjam.setText("");
    txtkop.setText("");
     txtterima.setText("");
    umakan=0;
    utransport=0;
    total=0;
}  
Untuk radio Button Kontrak              
private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                             
// TODO add your handling code here:
    umakan=8000*22;
    utransport=6000*22;
        total=umakan+utransport+gapok+tunjangan;
      
    txtUmakan.setText(String.valueOf(umakan)); 
    txtUtransport.setText(String.valueOf(utransport));
     txtTotal.setText(String.valueOf(total));    
}
Untuk Button Total gaji                               
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
// TODO add your handling code here:
    pphpasal21=gapok*1/150;
    jamsostek=gapok*1/100;
    koperasi=15000;
    terima=total-pphpasal21-jamsostek-koperasi;
    txtpph.setText(String.valueOf(pphpasal21)); 
    txtjam.setText(String.valueOf(jamsostek));
     txtkop.setText(String.valueOf(koperasi));
     txtterima.setText(String.valueOf(terima));
    
   
}                                     

-Disource package klik kanan > new > jframe form > beri nama > finish
-drag Panel > rubah warna
-Di pallete drag menu bar > edit text >beri nama
-Bentuklah designnya

-tulis kodingnya
Untuk Keluar
private void jMenu3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
    System.exit(0);
}
Untuk Ke Form Gaji
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
                new PSS_Cikarang().setVisible(true);
}

0 komentar:

Posting Komentar