how-to

Window (swing) applications

How to set password char in JPasswordField

Password char is implicitly "*" character. You can change it by javax.swing.JPasswordField.setEchoChar() method.

jPasswordField1.setEchoChar( '#' );

Change is performed immediately: