Why does JPasswordField.getPassword() create a String with the password in it?

This works for me and helps you to build a Stringified password:

String passText = new String(passField.getPassword());

Leave a Comment