private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed
        UserModel userModel = new UserModel();
        String maristID = maristUsernameTextField.getText();
        String password = UserModel.encodePassword(new String(passwordTextField.getPassword()));
        
        Iterable<Entry> userQuery = userModel.query("{maristID: '" + maristID + 
                "',password: '" + password + "'}");

        if (userQuery.iterator().hasNext()) {
            User user = (User) userQuery.iterator().next();
            if (userQuery.iterator().hasNext()) {
                System.out.println("More than one user found, exiting");
                this.dispose();
            } else {
                System.out.println(user.getMaristID());
                FOTE.setUser(user);
                FOTE.getMainFrame().setVisible(true);
                FOTE.getMainFrame().setTitle("FOTE - " + FOTE.getUser().getFullName());
                this.setVisible(false);
            }
        } else {
            System.out.println("No users found");
            maristUsernameTextField.setText("");
            passwordTextField.setText("");
        }

    }//GEN-LAST:event_loginButtonActionPerformed