How to make the text of a JPasswordField visible in java?

2

I've been researching how I could preview the key entered in a jPasswordField by pressing a JButton. But I happen to find nothing.

Could you tell me if you can, and if you can, how do you do it?

    
asked by Alexis Rodriguez 20.10.2016 в 09:16
source

1 answer

1

You have to use the setEchoChar () . Passing the value 0 indicates that you want to see the JPasswordField as if it were a JTextField

setEchoChar((char)0);

    
answered by 20.10.2016 / 09:17
source