Press "Enter" to skip to content

Delete operation in java gui.

Source code for delete page.

 int conf = JOptionPane.showConfirmDialog(null, "Do You Want to Delete...!!!","Delete",JOptionPane.YES_NO_OPTION);
if(conf == 0){
try{
String sql = "delete from user where id = ?";
pst = con.prepareStatement(sql);
pst.setString(1, jTextField_id.getText());
pst.execute();
JOptionPane.showMessageDialog(null, "Deleted Successfully...");
showValueInTable();
}catch(SQLException e){
JOptionPane.showMessageDialog(null, e);
}
}

To get help you can see the video.

Interface of after run the page.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *