J
James Kilroy
Hello I was wondering if you guys could spot a problem with this code
I am taking information from a password field and checking to ensure there
is only letters and digits. It seems to work with errors in JBuilder but
VisualAge is giving me errors. Any ideas
String Password=jpassword.getText(); //get password
int passwordSize=Password.length(); //get length of
password
for (int i=0;i<=passwordSize;i++){
char result=passwordSize.charAt(i);
if(!Character.isJavaLetterOrDigit(result)) {
JOptionPane.showMessageDialog(null,"Password can only
contain letters or digits","Error",
JOptionPane.WARNING_MESSAGE);
}
I am taking information from a password field and checking to ensure there
is only letters and digits. It seems to work with errors in JBuilder but
VisualAge is giving me errors. Any ideas
String Password=jpassword.getText(); //get password
int passwordSize=Password.length(); //get length of
password
for (int i=0;i<=passwordSize;i++){
char result=passwordSize.charAt(i);
if(!Character.isJavaLetterOrDigit(result)) {
JOptionPane.showMessageDialog(null,"Password can only
contain letters or digits","Error",
JOptionPane.WARNING_MESSAGE);
}