Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package latihan_tugas1;
import javax.swing.JOptionPane;
/**
*
* @author semangat
*/
public class Rumah_sakit_enggal_saras extends javax.swing.JFrame {
/**
* Creates new form Rumah_sakit_enggal_saras
*/
public Rumah_sakit_enggal_saras() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
cmbkode = new javax.swing.JComboBox<>();
enama = new javax.swing.JTextField();
espesialis = new javax.swing.JTextField();
ebyperiksa = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
enmobt = new javax.swing.JTextField();
ehrgobt = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
cmbobat = new javax.swing.JComboBox<>();
eubay = new javax.swing.JTextField();
ekembali = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jLabel3)
.addComponent(jLabel2)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(bbersih))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(layout.createSequentialGroup()
.addGap(24, 24, 24)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG, false)
.addComponent(enama)
.addComponent(espesialis)
.addComponent(ebyperiksa)
.addComponent(cmbkode,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGap(84, 84, 84)
.addComponent(bkeluar)))))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(eubay,
javax.swing.GroupLayout.PREFERRED_SIZE, 122,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel10)
.addGap(18, 18, 18)
.addComponent(ekembali,
javax.swing.GroupLayout.PREFERRED_SIZE, 122,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(55, 55, 55)
.addComponent(bhitung))
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 210,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(ebyperiksa,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5)))
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
108, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(bhitung)
.addComponent(btotalbayar))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(eubay,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9))
.addComponent(etobay, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jLabel10)
.addComponent(ekembali,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(11, 11, 11)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(bkeluar)
.addComponent(bbersih))))
.addContainerGap(36, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
//<=<=<=<=<= Coding Button Keluar =>=>=>=>=>
int answer = JOptionPane.showConfirmDialog
(null,"Yakin Ingin Keluar??..","Informasi",JOptionPane.YES_NO_OPTION);
if (answer==JOptionPane.YES_OPTION){
dispose();
}
else{
return;
}
}
private void ekembaliActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void cmbkodeActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
//<=<=<=<=<= Coding untuk JComboBox(Kode Dokter)=>=>=>=>=>
if (cmbkode.getSelectedItem().equals("DRJ01")){
enama.setText("RAFFA");
espesialis.setText("JANTUNG");
ebyperiksa.setText("200000");
}
else if (cmbkode.getSelectedItem().equals("DRA02")){
enama.setText("SHELIA ANISA");
espesialis.setText("ANAK");
ebyperiksa.setText("150000");
}
else if (cmbkode.getSelectedItem().equals("DRM03")){
enama.setText("PUTRI");
espesialis.setText("MATA");
ebyperiksa.setText("125000");
}
}
private void cmbobatActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
etobay.setText("");
eubay.setText("");
ekembali.setText("");
}
private void bhitungActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
//<=<=<=<=<= Coding untuk Button hitung =>=>=>=>=>
double biayaperiksa;
double hargaobat;
double uangbayar;
double nilai;
String hasil;
biayaperiksa=Integer.valueOf(ebyperiksa.getText());
hargaobat=Integer.valueOf(ehrgobt.getText());
uangbayar=Integer.valueOf(eubay.getText());
nilai= uangbayar - (biayaperiksa + hargaobat);
hasil = String.valueOf(nilai);
ekembali.setText(hasil);
}
private void hitung(java.awt.event.KeyEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default
look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Rumah_sakit_enggal_saras.class.getName()).l
og(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Rumah_sakit_enggal_saras.class.getName()).l
og(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Rumah_sakit_enggal_saras.class.getName()).l
og(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Rumah_sakit_enggal_saras.class.getName()).l
og(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Rumah_sakit_enggal_saras().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton bbersih;
private javax.swing.JButton bhitung;
private javax.swing.JButton bkeluar;
private javax.swing.JButton btotalbayar;
private javax.swing.JComboBox<String> cmbkode;
private javax.swing.JComboBox<String> cmbobat;
private javax.swing.JTextField ebyperiksa;
private javax.swing.JTextField ehrgobt;
private javax.swing.JTextField ekembali;
private javax.swing.JTextField enama;
private javax.swing.JTextField enmobt;
private javax.swing.JTextField espesialis;
private javax.swing.JTextField etobay;
private javax.swing.JTextField eubay;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
// End of variables declaration
}