Ejemplo n.º 1
0
  private void LoginBttnMouseClicked(java.awt.event.MouseEvent evt) {
    // TODO add your handling code here:
    String username = "******";
    String password = "******";
    String username1 = this.LoginField.getText();
    String password2 = this.PasswordField.getText();

    if ((username1.equals(username)) && (password2.equals(password))) {
      MainScreen w2 = new MainScreen();
      w2.setVisible(true);
      LoginField.setText("");
      PasswordField.setText("");
    } else {
      LoginField.setText("");
      PasswordField.setText("");
      JOptionPane.showMessageDialog(null, "Login Fail. Try again.");
    }

    // if login is correct, go to next screen
    // if login is incorrect, clear fields and retry
  }
Ejemplo n.º 2
0
  @Override
  public void initialize(URL location, ResourceBundle resources) {
    // Perform any initialization steps here.
    pc = PropertiesController.getPropertiesController();
    usernameTextField.setText(pc.getProp("username"));
    passwordPasswordField.setText(pc.getProp("password"));

    String signIn = pc.getProp("signInCheckbox");
    if (signIn == null) {
      signIn = "";
    }
    if (signIn.equals("true")) {
      keepMeLoggedInCheckBox.setSelected(true);
    }
  }