Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void bttambahActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- if(bttambah.getText().equalsIgnoreCase("tambah")){
- bttambah.setText("Refresh");
- bersih();
- SiapIsi(true);
- idcloth();
- //txidcloth.setEnabled(true);
- bttambah.setEnabled(true);
- btsimpan.setEnabled(true);
- bthapus.setEnabled(false);
- btedit.setEnabled(false);
- } else{
- bttambah.setText("Tambah");
- bersih();
- SiapIsi(false);
- TombolNormal();
- tabelinventory();
- }
- }
- private void btsimpanActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- if(txidcloth.getText().isEmpty()
- ||txnama.getText().isEmpty()
- ||txjenis.getText().isEmpty()
- ||txstok.getText().isEmpty()
- ||txhargamodal.getText().isEmpty()
- ||txhargajual.getText().isEmpty()
- ||txincome.getText().isEmpty()){
- JOptionPane.showMessageDialog(null, "LENGKAPI INPUTAN DATA!!!","",JOptionPane.INFORMATION_MESSAGE);
- } else{
- if(bttambah.getText().equalsIgnoreCase("Refresh")){
- if(bttambah.getText().equalsIgnoreCase("Refresh")){
- simpan();
- } else{
- JOptionPane.showMessageDialog(null, "SIMPAN DATA GAGAL, PERIKSA KEMBALI :( ","",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- if(btedit.getText().equalsIgnoreCase("batal")){
- if(btedit.getText().equalsIgnoreCase("batal")){
- edit();
- } else{
- JOptionPane.showMessageDialog(null, "EDIT DATA GAGAL, PERIKSA KEMBALI :( ","",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- bersih();
- SiapIsi(false);
- bttambah.setText("Tambah");
- btedit.setText("Edit");
- TombolNormal();
- }
- }
- private void bteditActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- if(btedit.getText().equalsIgnoreCase("edit")){
- btedit.setText("Batal");
- SiapIsi(true);
- bttambah.setEnabled(false);
- btsimpan.setEnabled(true);
- bthapus.setEnabled(false);
- btedit.setEnabled(true);
- } else{
- btedit.setText("Edit");
- bersih();
- SiapIsi(false);
- TombolNormal();
- }
- }
- private void bthapusActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- int pesan=JOptionPane.showConfirmDialog(null, "YAKIN DATA AKAN DIHAPUS ?","Konfirmasi",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
- if(pesan==JOptionPane.YES_OPTION){
- if(pesan==JOptionPane.YES_OPTION){
- hapus();
- bersih();
- SiapIsi(false);
- TombolNormal();
- } else{
- JOptionPane.showMessageDialog(null, "HAPUS DATA GAGAL :(");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement