Hi all,
I am wondering how should I retrieve the password which the user inputs to enter the program?
My interface consists of a JPasswordField. I have tried to use the following codes but it only returns me absurd string when I was doing testing.
Pls kindly advise.
String results = (String)rs.getObject(1);
if (jPasswordField.getPassword().toString().compareTo(results) == 0 )
{
hide();
Main main = new Main();
main.show();
}else {
txtresults.setText(jPasswordField.getPassword().toString());
//txtresults.setText("Incorrect User ID/password! Please try again.");
}
I am wondering how should I retrieve the password which the user inputs to enter the program?
My interface consists of a JPasswordField. I have tried to use the following codes but it only returns me absurd string when I was doing testing.
Pls kindly advise.
String results = (String)rs.getObject(1);
if (jPasswordField.getPassword().toString().compareTo(results) == 0 )
{
hide();
Main main = new Main();
main.show();
}else {
txtresults.setText(jPasswordField.getPassword().toString());
//txtresults.setText("Incorrect User ID/password! Please try again.");
}