Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard

Diff Revisions 2ac167 ... vs 520867 ... for ruralHouses/src/gui/LoginGUI.java

Diff revisions: vs.
  @@ -16,10 +16,6 @@
16 16 import businessLogic.LoginManager;
17 17 import businessLogic.LoginManagerInterface;
18 18 import domain.Account;
19 - import domain.Owner;
20 -
21 - import javax.swing.JRadioButton;
22 - import javax.swing.ButtonGroup;
23 19
24 20 public class LoginGUI extends JFrame {
25 21
  @@ -29,7 +25,6 @@
29 25 private JPasswordField passwordField;
30 26 private LoginManagerInterface loginManager = new LoginManager();
31 27 private JLabel loginFeedback;
32 - private final ButtonGroup buttonGroup = new ButtonGroup();
33 28 public LoginGUI() {
34 29 super();
35 30 initialize();
  @@ -86,7 +81,8 @@
86 81 private void jButton_ActionPerformed(ActionEvent e){
87 82
88 83 Account acc = loginManager.checkCredentials(usernameField.getText(),new String(passwordField.getPassword()));
89 - if (acc.getAdmin()) {
84 + if (acc == null) loginFeedback.setText("Incorrect username or password");
85 + else if( acc.getAdmin()) {
90 86 this.setVisible(false);
91 87 Frame a = new AdminMenuGUI();
92 88 a.setVisible(true);