How can I do password masking (to hide an input text from terminal window) in Java? I got the solution of using the console but I want to do it in an IDE (BLUEJ) ,which is not possible using the console. I want help.
Asked
Active
Viewed 112 times
0
-
This might just not be possible in BlueJ's console – sepp2k Jul 27 '18 at 11:29
-
Alternative would be creating separate window/dialog box with text field with masking. Something like [JOptionPane to get password](https://stackoverflow.com/q/8881213) – Pshemo Jul 27 '18 at 11:38
1 Answers
0
The console in any IDE or terminal/command line can not be edited after something is printed out in it and simply prints what you ask of it and takes in input that you type.
However, if you are working with a GUI in Swing or JavaFX, you can display your text in a JPasswordField or PasswordField which hides the input as its typed while still storing the correct string values.

faris
- 692
- 4
- 18