contoh aplikasi simple buat klinik (with netbeans)
contoh aplikasi simple buat klinik (with netbeans)
untuk source code nya :
Deklarasi Global Variable Integer:
public class Quiz extends javax.swing.JFrame {
int biayaadmin, konsultasi, obat, diskon,totalharga, total;
Coding pada Radio Button Umum:
private void jrbtnumumActionPerformed(java.awt.event.ActionEven t evt) {
if(jrbtnumum.isSelected()){
jtxtnadok.setText(“Mahfud Akbar”);
jtxtwktpraktek.setText(“Pagi”);
}
}
Coding pada Radio Button Gigi:
private void jrbtngigiActionPerformed(java.awt.event.ActionEven t evt) {
if(jrbtngigi.isSelected()){
jtxtnadok.setText(“Mutia Khanza”);
jtxtwktpraktek.setText(“Sore”);
}
}
Coding pada Radio Button Saraf:
private void jrbtnsarafActionPerformed(java.awt.event.ActionEve nt evt) {
if(jrbtnsaraf.isSelected()){
jtxtnadok.setText(“Annisa Susilowati”);
jtxtwktpraktek.setText(“Malam”);
}
}
Coding pada Combo Box Nama Ruang:
private void jconaruangActionPerformed(java.awt.event.ActionEve nt evt) {
if(jconaruang.getSelectedItem().equals(“Kenanga”)) {
jtxtharga.setText(“200000″);
int harga=Integer.parseInt(jtxtharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totalharga=harga*lama;
int potongan1=totalharga*10/100;
int potongan2=totalharga*0;
if (lama>4){
diskon=potongan1;
jtxtdiskon.setText(Integer.toString(potongan1));
total=totalharga-diskon+biayaadmin+obat+konsultasi;
jtxttotal.setText(String.valueOf(total));
}
else {
diskon=potongan2;
jtxtdiskon.setText(Integer.toString(potongan2));
total=totalharga-diskon+biayaadmin+obat+konsultasi;
jtxttotal.setText(String.valueOf(total));
}
}
else if(jconaruang.getSelectedItem().equals(“Mawar”)){
jtxtharga.setText(“300000″);
int harga=Integer.parseInt(jtxtharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totalharga=harga*lama;
int potongan1=totalharga*10/100;
int potongan2=totalharga*0;
if (lama>4){
diskon=potongan1;
jtxtdiskon.setText(Integer.toString(potongan1));
total=totalharga-diskon+biayaadmin+obat+konsultasi;
jtxttotal.setText(String.valueOf(total));
}
else {
diskon=potongan2;
jtxtdiskon.setText(Integer.toString(potongan2));
total=totalharga-diskon+biayaadmin+obat+konsultasi;
jtxttotal.setText(String.valueOf(total));
}
}
else if(jconaruang.getSelectedItem().equals(“Melati”)){
jtxtharga.setText(“400000″);
int harga=Integer.parseInt(jtxtharga.getText());
int lama=Integer.parseInt(jtxtlama.getText());
int totalharga=harga*lama;
int potongan1=totalharga*10/100;
int potongan2=totalharga*0;
if (lama>4){
diskon=potongan1;
jtxtdiskon.setText(Integer.toString(potongan1));
total=totalharga-diskon+biayaadmin+obat+konsultasi;
jtxttotal.setText(String.valueOf(total));
}
else {
diskon=potongan2;
jtxtdiskon.setText(Integer.toString(potongan2));
total=totalharga-diskon+biayaadmin+obat+konsultasi;
jtxttotal.setText(String.valueOf(total));
}
}
}
Coding pada Checck Box Administrasi:
private void jchkadminActionPerformed(java.awt.event.ActionEven t evt) {
if(jchkadmin.isSelected()) {
biayaadmin=5000;
jtxtadmin.setText(String.valueOf(biayaadmin));
int harga = Integer.parseInt(jtxtharga.getText());
int lama = Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtxtdiskon.getText()) ;
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtxttotal.setText(String.valueOf(total));
}
else {
biayaadmin=0;
jtxtadmin.setText(String.valueOf(biayaadmin));
int harga = Integer.parseInt(jtxtharga.getText());
int lama = Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtxtdiskon.getText()) ;
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtxttotal.setText(String.valueOf(total));
}
}
Coding pada Checck Box Konsultasi:
private void jchkkonsultasiActionPerformed(java.awt.event.Actio nEvent evt) {
if(jchkkonsultasi.isSelected()) {
konsultasi=20000;
jtxtkonsultasi.setText(String.valueOf(konsultasi)) ;
int harga = Integer.parseInt(jtxtharga.getText());
int lama = Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtxtdiskon.getText()) ;
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtxttotal.setText(String.valueOf(total));
}
else {
konsultasi=0;
jtxtkonsultasi.setText(String.valueOf(konsultasi)) ;
int harga = Integer.parseInt(jtxtharga.getText());
int lama = Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtxtdiskon.getText()) ;
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtxttotal.setText(String.valueOf(total));
}
}
Coding pada Checck Box Obat:
private void jchkobatActionPerformed(java.awt.event.ActionEvent evt) {
if(jchkobat.isSelected()) {
obat=50000;
jtxtobat.setText(String.valueOf(obat));
int harga = Integer.parseInt(jtxtharga.getText());
int lama = Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtxtdiskon.getText()) ;
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtxttotal.setText(String.valueOf(total));
}
else {
obat=0;
jtxtobat.setText(String.valueOf(obat));
int harga = Integer.parseInt(jtxtharga.getText());
int lama = Integer.parseInt(jtxtlama.getText());
int totaldiskon=Integer.parseInt(jtxtdiskon.getText()) ;
total=(harga*lama)-totaldiskon+biayaadmin+konsultasi+obat;
jtxttotal.setText(String.valueOf(total));
}
}
Bersih Button:
private void jbtnbersihActionPerformed(java.awt.event.ActionEve nt evt) {
jchkkonsultasi.setSelected(false);
jtxtkonsultasi.setText(” “);
jchkadmin.setSelected(false);
jtxtadmin.setText(” “);
jchkobat.setSelected(false);
jtxtobat.setText(” “);
jconaruang.setSelectedIndex(0);
jtxtlama.setText(” “);
jtxtharga.setText(” “);
jtxtnadok.setText(” “);
jtxtdiskon.setText(” “);
rbtngrpjepol.clearSelection();
jtxttotal.setText(” “);
jtxtnopasien.setText(” “);
jtxtnamapasien.setText(” “);
jtxtwktpraktek.setText(” “);
}
Keluar Button:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
dispose();
}
http://www.kaskus.us/showthread.php?p=274131096
0 komentar:
Posting Komentar