Night gan, there is a basic tutorial ya .. who knows aja useful: D
Immediately wrote, this time I will discuss about making aplikasi Hospitalized inpatient java
Check ...1. create database dbrawatinap
2. then create an outpatient table
3. make an inpatient form
This is the coding:
/*
* 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 rawatinap;
//import coding.koneksi;
import java.sql.*;
import java.text.SimpleDateFormat;
import javax.swing.JOptionPane;
import javax.swing.table.*;
/**
*
* @author black_box
*/
public class rawat extends javax.swing.JFrame {
Connection con;
ResultSet rs;
Statement stat;
String sql="";
String tgl;
String user ="root";
String pass="";
/**
* Creates new form mahasiswa
*/
public rawat() {
initComponents();
koneksi();
tampildata();
bersih();
}
/**
* 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() {
jInternalFrame1 = new javax.swing.JInternalFrame();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
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();
kode = new javax.swing.JTextField();
lama = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
harga = new javax.swing.JTextField();
kamar = new javax.swing.JTextField();
obat = new javax.swing.JTextField();
total = new javax.swing.JTextField();
nama = new javax.swing.JTextField();
jenis = new javax.swing.JComboBox();
jButton5 = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
tabelinap = new javax.swing.JTable();
jLabel11 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jInternalFrame1.setVisible(true);
jInternalFrame1.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setText("Kode Inap");
jLabel2.setText("Nama Pasien");
jLabel3.setText("Tanggal Inap");
jLabel4.setText("Jenis Kelamin");
jLabel5.setText("Total Bayar");
kode.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
kodeKeyPressed(evt);
}
});
lama.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lamaActionPerformed(evt);
}
});
jButton1.setText("Save");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Edit");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setText("Delete");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton4.setText("Sign Out");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jLabel6.setText("Lama Inap");
jLabel7.setText("Harga Sewa");
jLabel8.setText("Biaya Kamar");
jLabel9.setText("Biaya Obat");
kamar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
kamarActionPerformed(evt);
}
});
jenis.setEditable(true);
jenis.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Pilih", "Laki-Laki", "Perempuan" }));
jButton5.setText("Hitung");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(kode, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(nama, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(lama, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(harga, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(kamar, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(obat, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jenis, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(255, 255, 255))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButton1)
.addGap(35, 35, 35)
.addComponent(jButton2)
.addGap(18, 18, 18)
.addComponent(jButton3)
.addGap(15, 15, 15)
.addComponent(jButton5)
.addGap(18, 18, 18)
.addComponent(jButton4)))
.addGap(22, 22, 22))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(17, 17, 17)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel1))
.addComponent(kode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(8, 8, 8)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel2))
.addComponent(nama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(17, 17, 17)
.addComponent(jLabel3)
.addGap(11, 11, 11)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jenis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(9, 9, 9)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel9))
.addComponent(obat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel6))
.addComponent(lama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(12, 12, 12)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel7))
.addComponent(harga, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(10, 10, 10)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel8))
.addComponent(kamar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel5))
.addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(38, 38, 38)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton2)
.addComponent(jButton3)
.addComponent(jButton5))
.addComponent(jButton4))
.addGap(97, 97, 97))
);
jTabbedPane1.addTab("Entry Data Rawat", jPanel1);
tabelinap.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tabelinap.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
tabelinapPropertyChange(evt);
}
});
jScrollPane1.setViewportView(tabelinap);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 5, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Informasi Data rawat", jPanel2);
jInternalFrame1.getContentPane().add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, 440, 460));
jLabel11.setFont(new java.awt.Font("Kristen ITC", 1, 12)); // NOI18N
jLabel11.setText("Form Rawat");
jInternalFrame1.getContentPane().add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 20, 90, -1));
getContentPane().add(jInternalFrame1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 470, 550));
pack();
}// </editor-fold>
private void lamaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
try {
sql = "UPDATE rawat SET nama_pasien='"+
nama.getText()+"', tanggal_inap='"+
tanggal+"', jenis_kelamin='"+
jenis.getSelectedItem()+"', lama_inap='"+
obat.getText()+"', harga_sewa='"+
harga.getText()+"', biaya_kamar='"+
kamar.getText()+"', biaya_obat='"+
lama.getText()+"', total_bayar='"+
total.getText()+"' where kode_inap='"+kode.getText()+"'";
stat.executeUpdate(sql);
tampildata();
JOptionPane.showMessageDialog(rootPane, "Data Berhasil diedit!");
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, "Data gagal diedit!" +e);
}
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
sql="insert into rawat values(' "+
kode.getText()+" ',' "+
nama.getText()+" ',' "+
tgl+" ',' "+
jenis.getSelectedItem()+" ',' "+
obat.getText()+" ',' "+
lama.getText()+" ',' "+
harga.getText()+" ',' "+
kamar.getText()+" ',' "+
total.getText()+" ') ";
stat.execute(sql);
tampildata();
JOptionPane.showMessageDialog(rootPane, "Data Sudah Disimpan") ;
bersih();
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, "Data Tidak Disimpan" +e);
}
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
try {
sql = "delete from rawat where kode_inap='"+kode.getText()+"'";
stat.execute(sql);
JOptionPane.showMessageDialog(rootPane, "Data Berhasil Dihapus!");
bersih();
tampildata();
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, "Data Gagal Dihapus"+e);
}
}
private void kodeKeyPressed(java.awt.event.KeyEvent evt) {
try {
sql = "select * from rawat where kode_inap='"+kode.getText()+"'";
ResultSet rs = stat.executeQuery(sql);
while(rs.next()){
nama.setText(rs.getString(2));
tanggal.setDate(rs.getDate(3));
jenis.setSelectedItem(rs.getString(4));
obat.setText(rs.getString(5));
lama.setText(rs.getString(6));
harga.setText(rs.getString(7));
kamar.setText(rs.getString(8));
total.setText(rs.getString(9));
}
} catch (Exception e) {
}
}
private void tabelinapPropertyChange(java.beans.PropertyChangeEvent evt) {
// TODO add your handling code here:
}
private void kamarActionPerformed(java.awt.event.ActionEvent evt) {
}
private void tanggalPropertyChange(java.beans.PropertyChangeEvent evt) {
if(tanggal.getDate() !=null) {
SimpleDateFormat format=
new SimpleDateFormat("yyyy-MM-dd");
tgl=format.format(tanggal.getDate());
}
}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
int a,b,c,biaya;
int d,e,tot;
a=Integer.parseInt(lama.getText());
b=Integer.parseInt(harga.getText());
biaya=a*b;
kamar.setText(String.valueOf(biaya));
d=Integer.parseInt(obat.getText());
tot= biaya + d;
total.setText(String.valueOf(tot));
}
/**
* @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(rawat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(rawat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(rawat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(rawat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new rawat().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JTextField harga;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JInternalFrame jInternalFrame1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel11;
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;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JComboBox jenis;
private javax.swing.JTextField kamar;
private javax.swing.JTextField kode;
private javax.swing.JTextField lama;
private javax.swing.JTextField nama;
private javax.swing.JTextField obat;
private javax.swing.JTable tabelinap;
private javax.swing.JTextField total;
// End of variables declaration
public void koneksi(){
try{
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/dbrawat",user,pass);
stat = con.createStatement();
//JOptionPane.showMessageDialog(null, "Database Connected!");
}catch (ClassNotFoundException e){
JOptionPane.showMessageDialog(null, "Database Ok! " + e.getMessage());
}catch (SQLException e){
JOptionPane.showMessageDialog(null, "Database Connection Failed! " + e.getMessage());
}
}
public void tampildata(){
DefaultTableModel tabel = new DefaultTableModel();
tabel.addColumn("kode_inap");
tabel.addColumn("nama_pasien");
tabel.addColumn("tanggal_inap");
tabel.addColumn("jenis_kelamin");
tabel.addColumn("biaya_obat");
tabel.addColumn("lama_inap");
tabel.addColumn("harga_sewa");
tabel.addColumn("biaya_kamar");
tabel.addColumn("total_bayar");
try {
String sql = "select * from rawat order by kode_inap asc";
ResultSet rs = stat.executeQuery(sql);
while(rs.next()){
tabel.addRow(new Object[]{
rs.getString(1),
rs.getString(2),
rs.getString(3),
rs.getString(4),
rs.getString(5),
rs.getString(6),
rs.getString(7),
rs.getString(8),
rs.getString(9),
});
}
tabelinap.setModel(tabel);
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Error SQL " + e.getMessage());
}
}
public void bersih(){
kode.setText("");
nama.setText("");
tanggal.setDate(null);
jenis.setSelectedItem("");
obat.setText("");
lama.setText("");
harga.setText("");
kamar.setText("");
total.setText("");
}
}
Immediately wrote, this time I will discuss about making aplikasi Hospitalized inpatient java
Check ...1. create database dbrawatinap
2. then create an outpatient table
3. make an inpatient form
This is the coding:
/*
* 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 rawatinap;
//import coding.koneksi;
import java.sql.*;
import java.text.SimpleDateFormat;
import javax.swing.JOptionPane;
import javax.swing.table.*;
/**
*
* @author black_box
*/
public class rawat extends javax.swing.JFrame {
Connection con;
ResultSet rs;
Statement stat;
String sql="";
String tgl;
String user ="root";
String pass="";
/**
* Creates new form mahasiswa
*/
public rawat() {
initComponents();
koneksi();
tampildata();
bersih();
}
/**
* 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() {
jInternalFrame1 = new javax.swing.JInternalFrame();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
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();
kode = new javax.swing.JTextField();
lama = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
harga = new javax.swing.JTextField();
kamar = new javax.swing.JTextField();
obat = new javax.swing.JTextField();
total = new javax.swing.JTextField();
nama = new javax.swing.JTextField();
jenis = new javax.swing.JComboBox();
jButton5 = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
tabelinap = new javax.swing.JTable();
jLabel11 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jInternalFrame1.setVisible(true);
jInternalFrame1.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setText("Kode Inap");
jLabel2.setText("Nama Pasien");
jLabel3.setText("Tanggal Inap");
jLabel4.setText("Jenis Kelamin");
jLabel5.setText("Total Bayar");
kode.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
kodeKeyPressed(evt);
}
});
lama.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lamaActionPerformed(evt);
}
});
jButton1.setText("Save");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Edit");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setText("Delete");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton4.setText("Sign Out");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jLabel6.setText("Lama Inap");
jLabel7.setText("Harga Sewa");
jLabel8.setText("Biaya Kamar");
jLabel9.setText("Biaya Obat");
kamar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
kamarActionPerformed(evt);
}
});
jenis.setEditable(true);
jenis.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Pilih", "Laki-Laki", "Perempuan" }));
jButton5.setText("Hitung");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(kode, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(nama, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(lama, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(harga, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(kamar, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(obat, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jenis, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(255, 255, 255))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButton1)
.addGap(35, 35, 35)
.addComponent(jButton2)
.addGap(18, 18, 18)
.addComponent(jButton3)
.addGap(15, 15, 15)
.addComponent(jButton5)
.addGap(18, 18, 18)
.addComponent(jButton4)))
.addGap(22, 22, 22))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(17, 17, 17)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel1))
.addComponent(kode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(8, 8, 8)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel2))
.addComponent(nama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(17, 17, 17)
.addComponent(jLabel3)
.addGap(11, 11, 11)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jenis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(9, 9, 9)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel9))
.addComponent(obat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel6))
.addComponent(lama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(12, 12, 12)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel7))
.addComponent(harga, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(10, 10, 10)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel8))
.addComponent(kamar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel5))
.addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(38, 38, 38)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton2)
.addComponent(jButton3)
.addComponent(jButton5))
.addComponent(jButton4))
.addGap(97, 97, 97))
);
jTabbedPane1.addTab("Entry Data Rawat", jPanel1);
tabelinap.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tabelinap.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
tabelinapPropertyChange(evt);
}
});
jScrollPane1.setViewportView(tabelinap);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 5, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Informasi Data rawat", jPanel2);
jInternalFrame1.getContentPane().add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, 440, 460));
jLabel11.setFont(new java.awt.Font("Kristen ITC", 1, 12)); // NOI18N
jLabel11.setText("Form Rawat");
jInternalFrame1.getContentPane().add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 20, 90, -1));
getContentPane().add(jInternalFrame1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 470, 550));
pack();
}// </editor-fold>
private void lamaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
try {
sql = "UPDATE rawat SET nama_pasien='"+
nama.getText()+"', tanggal_inap='"+
tanggal+"', jenis_kelamin='"+
jenis.getSelectedItem()+"', lama_inap='"+
obat.getText()+"', harga_sewa='"+
harga.getText()+"', biaya_kamar='"+
kamar.getText()+"', biaya_obat='"+
lama.getText()+"', total_bayar='"+
total.getText()+"' where kode_inap='"+kode.getText()+"'";
stat.executeUpdate(sql);
tampildata();
JOptionPane.showMessageDialog(rootPane, "Data Berhasil diedit!");
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, "Data gagal diedit!" +e);
}
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
sql="insert into rawat values(' "+
kode.getText()+" ',' "+
nama.getText()+" ',' "+
tgl+" ',' "+
jenis.getSelectedItem()+" ',' "+
obat.getText()+" ',' "+
lama.getText()+" ',' "+
harga.getText()+" ',' "+
kamar.getText()+" ',' "+
total.getText()+" ') ";
stat.execute(sql);
tampildata();
JOptionPane.showMessageDialog(rootPane, "Data Sudah Disimpan") ;
bersih();
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, "Data Tidak Disimpan" +e);
}
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
try {
sql = "delete from rawat where kode_inap='"+kode.getText()+"'";
stat.execute(sql);
JOptionPane.showMessageDialog(rootPane, "Data Berhasil Dihapus!");
bersih();
tampildata();
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, "Data Gagal Dihapus"+e);
}
}
private void kodeKeyPressed(java.awt.event.KeyEvent evt) {
try {
sql = "select * from rawat where kode_inap='"+kode.getText()+"'";
ResultSet rs = stat.executeQuery(sql);
while(rs.next()){
nama.setText(rs.getString(2));
tanggal.setDate(rs.getDate(3));
jenis.setSelectedItem(rs.getString(4));
obat.setText(rs.getString(5));
lama.setText(rs.getString(6));
harga.setText(rs.getString(7));
kamar.setText(rs.getString(8));
total.setText(rs.getString(9));
}
} catch (Exception e) {
}
}
private void tabelinapPropertyChange(java.beans.PropertyChangeEvent evt) {
// TODO add your handling code here:
}
private void kamarActionPerformed(java.awt.event.ActionEvent evt) {
}
private void tanggalPropertyChange(java.beans.PropertyChangeEvent evt) {
if(tanggal.getDate() !=null) {
SimpleDateFormat format=
new SimpleDateFormat("yyyy-MM-dd");
tgl=format.format(tanggal.getDate());
}
}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
int a,b,c,biaya;
int d,e,tot;
a=Integer.parseInt(lama.getText());
b=Integer.parseInt(harga.getText());
biaya=a*b;
kamar.setText(String.valueOf(biaya));
d=Integer.parseInt(obat.getText());
tot= biaya + d;
total.setText(String.valueOf(tot));
}
/**
* @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(rawat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(rawat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(rawat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(rawat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new rawat().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JTextField harga;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JInternalFrame jInternalFrame1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel11;
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;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JComboBox jenis;
private javax.swing.JTextField kamar;
private javax.swing.JTextField kode;
private javax.swing.JTextField lama;
private javax.swing.JTextField nama;
private javax.swing.JTextField obat;
private javax.swing.JTable tabelinap;
private javax.swing.JTextField total;
// End of variables declaration
public void koneksi(){
try{
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/dbrawat",user,pass);
stat = con.createStatement();
//JOptionPane.showMessageDialog(null, "Database Connected!");
}catch (ClassNotFoundException e){
JOptionPane.showMessageDialog(null, "Database Ok! " + e.getMessage());
}catch (SQLException e){
JOptionPane.showMessageDialog(null, "Database Connection Failed! " + e.getMessage());
}
}
public void tampildata(){
DefaultTableModel tabel = new DefaultTableModel();
tabel.addColumn("kode_inap");
tabel.addColumn("nama_pasien");
tabel.addColumn("tanggal_inap");
tabel.addColumn("jenis_kelamin");
tabel.addColumn("biaya_obat");
tabel.addColumn("lama_inap");
tabel.addColumn("harga_sewa");
tabel.addColumn("biaya_kamar");
tabel.addColumn("total_bayar");
try {
String sql = "select * from rawat order by kode_inap asc";
ResultSet rs = stat.executeQuery(sql);
while(rs.next()){
tabel.addRow(new Object[]{
rs.getString(1),
rs.getString(2),
rs.getString(3),
rs.getString(4),
rs.getString(5),
rs.getString(6),
rs.getString(7),
rs.getString(8),
rs.getString(9),
});
}
tabelinap.setModel(tabel);
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Error SQL " + e.getMessage());
}
}
public void bersih(){
kode.setText("");
nama.setText("");
tanggal.setDate(null);
jenis.setSelectedItem("");
obat.setText("");
lama.setText("");
harga.setText("");
kamar.setText("");
total.setText("");
}
}
No comments:
Post a Comment