Username field should come pre-filled with the username of the most recent user

Viewed 28

I would like my app to retrieve the most recent signed-in username on the login page. Instead of the username field coming when it's blank, I would like it to come when it is pre-filled with the username of the most recent user.

1 Answers

Do something like this when initializing the text field:

myTextField.setText(Preferences.get("lastLogin", ""));

Then in the logged-in event processing code:

Preferences.put("lastLogin", myTextField.getText());
Related