Saturday, 17 August 2013

java && on if statement is not working

java && on if statement is not working

if ((jTextFieldAccountName.getText().isEmpty()) &&
(jPasswordFieldAccountPassword.getPassword().length == 0)) {
jButton_Next.setEnabled(false);
}
else {
jButton_Next.setEnabled(true);
}
Hi when I try to run it... and then type on jTextField the button is
Enabled even I didn't type on the jPasswordField.. looks like OR not
AND...
i want to output like when I type on jTextField and jPasswordField the
button enabled... and if I only type jTextField the button is disabled..
and when the jTextField is empty and I only type jPasswordField the button
is disabled... it only enabled when I insert on those two.. help me please
if i'm doing it wrong..

No comments:

Post a Comment