Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

limit login attempts  RSS feed

 
dan sidebottom
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi how do i change this code to limit user attempts to 3?

public void validateUser(String name, String password) {
if (name.equals("admin") && password.equals("letmein")) {
display.setCurrent(list1);
} else {
tryAgain();
}
}
public void tryAgain() {
Alert error = new Alert("Login Incorrect", "Please try again", null, AlertType.ERROR);

Many thanks
 
Tim Holloway
Bartender
Posts: 18548
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Dan.

Question #1: Is this supposed to have anything at all to do with Java Mobile Edition?

Question #2: What sort of system is this code supposed to be part of? Is it web-based? An applet? Servlet? Stand-alone application?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!