Advertisement
Guest User

Untitled

a guest
Oct 30th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1.     private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {                                        
  2.  
  3.         String sUsername = tfUser.getText();
  4.         String sPassword = pfPass.getText();
  5.         boolean ValidLogin = false;
  6.  
  7.         try (Scanner file = new Scanner(new File("LoginDetails.txt"))) {
  8.             while (file.hasNext()) {
  9.                 String next = file.nextLine();
  10.                 String[] arr = next.split("/");
  11.                 if (arr[0].equals(sUsername '&&' arr[1].equals(sPassword)) {
  12.                         this.setVisible(false);
  13.                    
  14.             }else {
  15.                     ValidLogin = false;
  16.                 }
  17.             }
  18.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement