Sunday, April 6, 2014

Membuat Aplikasi Klinik

Hai guys lama tak update neh blog haha ma'lum sibuk di dunia nyata haha
oke kali ini sant's buat  aplikasi sederhana tentang klinik hehe meski belum terintegrasi ke db hihihi.
kali ini sant's
sant's mengabungkan beberapa komponen yang baru sant's pelajar menggunakan combobox,radio button,dan chekbox hehe
oke deh gini cerita nya suatu klinik ingin menghitung otomatis total pembayaran pasien nya
ketika radio button poli di klik maka akan keluar nama dokter dan jam kerja nya,lama inap input manual,data pasien:no pasien,nama pasien input manual.
apabila memilih ruangan pada combobox maka akan akan muncul Harga/hari, Diskon, dan Total akan muncul sesuai pilihan.apabila chek box ada rincian biaya maka akan bertambah otomatis.
apabila di klik tombol resik maka screen kan bersih ,dan bila di klik tombol metu maka akan keluar hehe

nah ini dia source code nya
deklarasi global
int biayaadmin,konsultasi,obat,totalharga,diskon,total;
script pada radio button umum
private void jbtumumActionPerformed(java.awt.event.ActionEvent evt) {                                       
if(jbtumum.isSelected()){
    jtexnadok.setText("umar");
    jtexwktpraktek.setText("pagi");
}

script pada radio button gigi
private void jbtgigiActionPerformed(java.awt.event.ActionEvent evt) {                                       
if (jbtgigi.isSelected()){
jtexnadok.setText("dani");
jtexwktpraktek.setText("siang");
}
script pada radio button syaraf
private void jbtsyarafActionPerformed(java.awt.event.ActionEvent evt) {                                         
if(jbtsyaraf.isSelected()){
jtexnadok.setText("sarwono");
jtexwktpraktek.setText("malam");
}
script pada combo box ruangan
private void jconaruangActionPerformed(java.awt.event.ActionEvent evt) {                                          
if (jconaruang.getSelectedItem().equals("kenanga")){
jtexharga.setText("300000");
int harga=Integer.parseInt(jtexharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totalharga= harga*lama;
int potongan1=totalharga*10/100;
int potongan2=totalharga*10;
if (lama>4){
diskon=potongan1;
jtexdiskon.setText(Integer.toString(potongan1));
total=totalharga-diskon+biayaadmin+obat+konsultasi;
jtextotal.setText(String.valueOf(total));

}
else{
diskon=potongan2;
jtexdiskon.setText(Integer.toString(potongan2));
total=totalharga-diskon+biayaadmin+obat+konsultasi;
jtextotal.setText(String.valueOf(total));
}     
}
else if(jconaruang.getSelectedItem().equals("melati")){
jtexharga.setText("600000");
int harga=Integer.parseInt(jtexharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totalharga=harga*lama;
int potongan1=totalharga*10/100;
int potongan2=totalharga*10;
if(lama>4){
diskon=potongan1;
jtexdiskon.setText(Integer.toString(potongan1));
total=totalharga-diskon+biayaadmin+obat+konsultasi;
jtextotal.setText(String.valueOf(total));
}
}
source pada chebox administrasi
private void jcadminActionPerformed(java.awt.event.ActionEvent evt) {                                       
if (jcadmin.isSelected()){
biayaadmin=10000;
jtexadmin.setText(String.valueOf(biayaadmin));
int harga=Integer.parseInt(jtexharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtexdiskon.getText());
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtextotal.setText(String.valueOf(total));
}
else{
biayaadmin=0;
jtexadmin.setText(String.valueOf(biayaadmin));
int harga=Integer.parseInt(jtexharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtexdiskon.getText());
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtextotal.setText(String.valueOf(total));
}
source chexbox pada konsultasi
 private void jckonsulActionPerformed(java.awt.event.ActionEvent evt) {                                        
if (jckonsul.isSelected()){
konsultasi=20000;
jtextkonsultasi.setText(String.valueOf(konsultasi));
int harga=Integer.parseInt(jtexharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtexdiskon.getText());
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtextotal.setText(String.valueOf(total));
}
else{
konsultasi=0;
jtextkonsultasi.setText(String.valueOf(konsultasi));
int harga=Integer.parseInt(jtexharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtexdiskon.getText());
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtextotal.setText(String.valueOf(total));
}     // TODO add your handling code here:
    }                                       
souce chexbox pada obat
 private void jcobatActionPerformed(java.awt.event.ActionEvent evt) {                                      
if (jcobat.isSelected()){
obat=50000;
jtexobat.setText(String.valueOf(obat));
int harga=Integer.parseInt(jtexharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtexdiskon.getText());
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtextotal.setText(String.valueOf(total));
}
else{
obat=0;
jtexobat.setText(String.valueOf(obat));
int harga=Integer.parseInt(jtexharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtexdiskon.getText());
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtextotal.setText(String.valueOf(total));
}     // TODO add your handling code here:
    }                                     
souce code pada resik
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
jcobat.setSelected(false);
jtexobat.setText("");
jckonsul.setSelected(false);
jtextkonsultasi.setText("");
jcadmin.setSelected(false);
jtexadmin.setText("");
jtexnadok.setText("");
jtexwktpraktek.setText("");
jtxtlama.setText("");
jtextpasien.setText("");
jtextno.setText("");
jconaruang.setSelectedIndex(0);
jtexharga.setText("");
jtexdiskon.setText("");
jtextotal.setText("");
buttonGroup1.clearSelection();

        // TODO add your handling code here:
    }                 
source pada tombol metu
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
dispose();
        // TODO add your handling code here:
    }   
ini screnn shot setelah jadi



Newer Posts Older Posts Home