java - How to lock button for 30 seconds if incorrect username/password 3 times? -


this code have. reads text file , compares users input. have been trying add counter++ , once count =3 can't work. feel should easy....

boolean login = false;  while (read.nextline() !=null) {     string user = read.next();      string pass = read.next();      read.next();      if(usernamet.gettext().equals(user) && passwordt.gettext().equals(pass)) {         login = true;         break;                      } }  if (login) {     new menu(); } else {     joptionpane.showmessagedialog(null, "incorrect username or password");      usernamet.settext("");      passwordt.settext(""); } 

am thinking along write lines?

for(count=0;count<4){ if(login) new menu(); else { joptionpane.showmessagedialog(null, "incorrect  username or password"); usernamet.settext(""); passwordt.settext(""); count++  } }  

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -