Rabu, 27 Oktober 2010

Contoh source code java netbeans IDE untuk TOMBOL EDIT

private void veditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_veditActionPerformed
        String a="",b="",c="",d="",f="",g="",h="",i="",j="";
        a = vnoktp.getSelectedItem().toString();
        b = vno_kk.getSelectedItem().toString();
        c = vnama.getText();
        d = vjekel.getText();
        f = vtglwafat.getDateFormatString();
        g = vhari.getSelectedItem().toString();
        h = vtmp.getText();
        i = vsbb.getText();
        j = vdesa.getSelectedItem().toString();




        int ok = JOptionPane.showConfirmDialog(null, "Anda Yakin  Data Ini Akan Diedit ??? ","",JOptionPane.YES_NO_OPTION);
        if (ok==0){

            try {
                koneksidb();
                sql = "update dbmeninggal set no_ktp='"+a+"',no_kk='"+b+"',nama='"+c+"',jekel='"+d+"',tgl='"+f+"',hari='"+g+"',tempat='"+h+"',sebab='"+i+"',desa='"+j+"' where no_ktp ='"+a+"'";
                st.execute(sql);
                kosong();
                JOptionPane.showMessageDialog(null, "Data Telah Diedit");
            } catch (Exception e) {JOptionPane.showMessageDialog(null, ""+e);
            } tampiltabel();
        }//GEN-LAST:event_veditActionPerformed
    }

Tidak ada komentar:

Posting Komentar