Password Fields With Limited Characters
Hey Guys, Im currently learning Java and my teacher has asked me to make a Password Checker. Like ones on forums when you register. So it asks you to type your password and then you gotta retype. Im supposed to make it make sure its not empty, Make sure they are the same, and make sure it uses atleast 8 characters. Im having some problems with the comparing and the limations on the characters. Think somebody can help me?
When I have That above, It errors.
Why does it error like that?
I cannot figure out how to Make sure they have typed atleast 8 characters either, anyone care to help me out with that part?
Code:
private void btnSubmitMouseClicked(java.awt.event.MouseEvent evt) {
int Password;
if(pwPassword.getPassword.isEmpty()){
JOptionPane.showMessageDialog(mainPanel,"Error: Please Enter Your Password.","Error Message", JOptionPane.ERROR_MESSAGE);
}
else if(pwPassword.getPassword().equals(pwPasswordRe.getPassword())){
JOptionPane.showMessageDialog(mainPanel,"Success: Passwords were Successfully entered","Success Message", JOptionPane.INFORMATION_MESSAGE);
}
Why does it error like that?
I cannot figure out how to Make sure they have typed atleast 8 characters either, anyone care to help me out with that part?


