Press "Enter" to skip to content

Forgot password code of library management system.

What is java GUI ?

GUI stands for Graphical User Interface, a term used not only in Java but in all programming languages that support the development of GUIs. A program’s graphical user interface presents an easy-to-use visual display to the user.

To get help you can see the video.

Source code for forgot password page.

Connection con = null;
ResultSet rs;
PreparedStatement pst;

public forgotPass() {
initComponents();
con = Connect.dbConnect();
middle();
}

public void middle(){
setLocationRelativeTo(null);
}
try{
String sql2 = "select password from admin where email = '"+emailTX.getText()+"' and ans='"+answerTF.getText()+"' ";
pst = con.prepareStatement(sql2);
rs = pst.executeQuery();
if(rs.next()){
jTextField5.setText(rs.getString("password"));
}else{
JOptionPane.showMessageDialog(null, "Wrong Answer...!!!");
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
try{
String sql = "select * from admin where email = '"+emailTX.getText()+"' ";
pst = con.prepareStatement(sql);
rs = pst.executeQuery();
if(rs.next()){
jTextField2.setText(rs.getString("username"));
jTextField3.setText(rs.getString("s_que"));
}else{
JOptionPane.showMessageDialog(null, "Wrong Email...!!!");
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}

Interface of after run the forgot password page.

Be First to Comment

Leave a Reply

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