1

When i use console.readPassword() to read user passwords through console, there is always one line added to the console.

How to disable this behavior or how to delete that extra line (and move the cursor after the last character in the line before)? What escape character to use?

Thanks

Beaver
  • 257
  • 5
  • 12
  • You could check out some console related questions: http://stackoverflow.com/questions/301759/java-console-pretty-printing-returning-to-the-start-of-a-line You could emit some backspace character or some ANSI escape sequence. – akarnokd Jul 08 '09 at 20:51
  • I saw that before posting my question. :) I don't know why javamonkey79's answer isn't here, but it seems that readPassword method isn't the one which is adding that extra line. It could be the event of pressing the "Enter" key... Maybe i should try to remove it with the separated thread, don't know. The idea behind all this is to read password with the already implemented console.readPassword() method and after that to print some asterisks in the same line. – Beaver Jul 09 '09 at 10:25

1 Answers1

0

console.readPassword() does not an extra line. It must be something else that does that.

Sandeep Kaul
  • 2,957
  • 2
  • 20
  • 36