Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

private void rUmumActionPerformed(java.awt.event.

ActionEvent evt) {
// TODO add your handling code here:
if (rUmum.isSelected())
{tnmdok.setText("dr Wawan");
twaktu.setText("Pagi");}
}

private void rGigiActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
if (rGigi.isSelected())
{tnmdok.setText("dr Wati");
twaktu.setText("Pagi");}
}

private void rsarafActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
if (rsaraf.isSelected())
{tnmdok.setText("dr Sudro");
twaktu.setText("Pagi");}
}

private void cbNamaActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
if (cbNama.getSelectedItem().equals("Kenanga"))
tharga.setText("150000");
else if (cbNama.getSelectedItem().equals("Melati"))
tharga.setText("200000");
else if (cbNama.getSelectedItem().equals("Mawar"))
tharga.setText("300000");

int lama,harga,diskon;
lama=Integer.parseInt(tlama.getText());
harga=Integer.parseInt(tharga.getText());
if (lama>4)
diskon=(int) (lama * harga * 0.1);
else
diskon=0;
tdiskon.setText(Integer.toString(diskon));
}

private void tnoActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
if (tno.getText().equals("abd001"))
tnmpas.setText("Abdul Kadir");
else if (tno.getText().equals("ftm001"))
tnmpas.setText("Fatimah");
}

private void cAActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
if (cA.isSelected())
tadm.setText("10000");
else
tadm.setText("0");
double adm=0,kon=0,obat=0,total;
adm=Double.parseDouble(tadm.getText());
kon=Double.parseDouble(tkon.getText());
obat=Double.parseDouble(tobat.getText());
total=adm+kon+obat;
ttotal.setText(Double.toString(total));
}

private void cKActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

if (cK.isSelected())
tkon.setText("100000");
else
tkon.setText("0");

double adm=0,kon=0,obat=0,total;
adm=Double.parseDouble(tadm.getText());
kon=Double.parseDouble(tkon.getText());
obat=Double.parseDouble(tobat.getText());

total=adm+kon+obat;
ttotal.setText(Double.toString(total));
}

private void cOActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
if (cO.isSelected())
tobat.setText("150000");
else
tobat.setText("0");
double adm=0,kon=0,obat=0,total;
adm=Double.parseDouble(tadm.getText());
kon=Double.parseDouble(tkon.getText());
obat=Double.parseDouble(tobat.getText());
total=adm+kon+obat;
ttotal.setText(Double.toString(total));
}

private void cmdbersihActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
rpoli.clearSelection();
tnmdok.setText("");
twaktu.setText("");
tno.setText("");
tnmpas.setText("");
tlama.setText("0");
tharga.setText("0");
tdiskon.setText("0");
tadm.setText("0");
tkon.setText("0");
tobat.setText("0");
cA.setText("false");
cK.setText("false");
cO.setText("false");
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
tadm.setText("0");
tkon.setText("0");
tobat.setText("0");
}

You might also like