private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed

        loginLabel.setText("Loggin in...");

        if (uNameField.getText().equals("")) {
            JOptionPane.showMessageDialog(this,
                    "Please enter a username.",
                    "No Username",
                    JOptionPane.ERROR_MESSAGE);
        } else if (passField.getPassword().length == 0) {
            JOptionPane.showMessageDialog(this,
                    "Please enter a password.",
                    "No password",
                    JOptionPane.ERROR_MESSAGE);
        } else {

            User u = (User) MongoHelper.fetch(new User(uNameField.getText()),
                    MongoHelper.USER_COLLECTION);

            //have a user and user password checks out
            if (u != null && u.checkPass(new String(passField.getPassword()))) {

                MainInterface m = new MainInterface(new DataManager(u.getId()));
                m.setVisible(true);
                this.dispose();
            } else {
                //loginLabel.setText("Username or Password incorrect");
                JOptionPane.showMessageDialog(this,
                        "Username or Password incorrect.",
                        "Login Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_loginButtonActionPerformed