Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {
- String sUsername = tfUser.getText();
- String sPassword = pfPass.getText();
- boolean ValidLogin = false;
- try (Scanner file = new Scanner(new File("LoginDetails.txt"))) {
- while (file.hasNext()) {
- String next = file.nextLine();
- String[] arr = next.split("/");
- if (arr[0].equals(sUsername '&&' arr[1].equals(sPassword)) {
- this.setVisible(false);
- }else {
- ValidLogin = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement