title: Login on java based from txt file
body: <p>need help!, i have an assignment i need to make an login txt based, my program only read the first line </p>
  
  <p>the txt look like this </p>
  
  <pre><code>Luthfi Luthfi Fitra
  Fitra Fitra Khori
  Khori Fitra Syifa
  </code></pre>
  
  <p>but it only read the first, so i could log in only using the top account 
  here is my code</p>
  
  <pre><code>        public Login() {
      initComponents();
      txtPass.setText("");
  }
  
  public void Masuk(){
  try {
  String lokasi = "D:/settings.txt";
  String username = txtUser.getText();
  String password = txtPass.getText();
  
  
          FileReader fr = new FileReader(lokasi);
          BufferedReader br = new BufferedReader(fr);
          String line,user,pass;
          boolean isLoginSuccess = false;
         while ((line = br.readLine()) != null) {
             user = line.split(" ")[1].toLowerCase();
      pass = line.split(" ")[2].toLowerCase();
             if (user.equals(username) &amp;&amp; pass.equals(password)){
                 isLoginSuccess = true;
                 this.dispose();
                 MainMenu mm = new MainMenu();
                 mm.setLocationRelativeTo(null);
                 mm.setVisible(true);
                 break;
             }
             else{
                 JOptionPane.showMessageDialog(null, "USERNAME/PASSWORD SALAH","WARNING!!",JOptionPane.WARNING_MESSAGE);
                 break;
             }
         }
         fr.close();
  
  }catch(Exception e){
  e.printStackTrace();
      }
          }
  </code></pre>
  
  <p>also why is everytime i insert the correct username and id it shows me that im succses but it show me the USERNAME/PASSWORD IS WRONG too</p>