If I run a program in command, and I want the user to type password without being seen -
I want '******' instead of the real letters.
How can I do it when I run my class in windows command ? It is not swing, only simple j2se class.
I saw an example that runs another thread that fills the command with blank spaces or with stars... but
it is not elegant as typing '*****' instead of the real characters.
Maybe it is imposible, but if there is a way I'll be glad to hear.
Console will work, but you need a fallback. If you use javaw or similar to start the application, the Console will be null, so you get Exceptions. In that case you would have to us other entry types, eg JOptionPane, JPasswordField.
subject: prevent characters from being desplayed on command