SHARE
TWEET

Untitled

a guest Jun 18th, 2017 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int counter = 0;
  2.         int i = 0;
  3.         // for (int i = 0; i <= 3; i++) {
  4.         while (i < 3) {
  5.             String au = ausernametxt.getText();
  6.             String ap = apasswordtxt.getText();
  7.  
  8.             String pass = "111";
  9.             String user = "zsa";
  10.  
  11.             if (user.equals(ausernametxt.getText()) && (pass.equals(apasswordtxt.getText()))) {
  12.                 JOptionPane.showMessageDialog(null, "Successfully log in!");
  13.                 new menu().setVisible(true);
  14.  
  15.             }
  16.  
  17.             if (user != (ausernametxt.getText()) && (pass.equals(apasswordtxt.getText()))) {
  18.                 JOptionPane.showMessageDialog(null, "Invalid User No", "LOG IN", JOptionPane.ERROR_MESSAGE);
  19.                 counter += 1;
  20.                 System.out.println(counter);
  21.  
  22.             }
  23.  
  24.             if (user.equals(ausernametxt.getText()) && (pass != (apasswordtxt.getText()))) {
  25.                 JOptionPane.showMessageDialog(null, "Invalid Password", "LOG IN", JOptionPane.ERROR_MESSAGE);
  26.                 counter++;
  27.                 System.out.println(counter);
  28.  
  29.             } else {
  30.  
  31.  
  32.                 JOptionPane.showMessageDialog(null, "You Inputed 3 wrong password/Username", "LOG IN", JOptionPane.ERROR_MESSAGE);
  33.  
  34.                 System.exit(0);
  35.             }
  36.  
  37.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top