How to set Jtextfield Maxlength?..
I have coded my password field's length like this. But i wanna set the password field to 8 characters, user can't write anything bigger than 8 characters. how can i do that ? is there anything something like "textfield maxlength" in jtextfield proporties ??? Waiting for you help...
Code:
String password = txtPassword.getText().trim();
int passwordLength = sifre.length();
...
...
else if(passwordLength != 8 ) {
JOptionPane.showMessageDialog(null, "Your password must be 8 characters!..");
boolean requestFocusInWindow = txtPassword.requestFocusInWindow();
}
...
...
Best Regards...