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);
}
Be First to Comment