
-----------------------------------
uberwalla
Sun Feb 24, 2008 11:50 am

View input as &quot;*&quot;
-----------------------------------
hey just wondering if there is a way to take input from Scanner type input and turn anything typed into asterix' (*) so that if your this say making a password field, the password won't show.

-----------------------------------
HeavenAgain
Sun Feb 24, 2008 1:12 pm

RE:View input as &quot;*&quot;
-----------------------------------
it is impossible to do that with Scanner, however you can use the swing class'  [url=http://java.sun.com/docs/books/tutorial/uiswing/components/passwordfield.html]JPasswordField

-----------------------------------
richcash
Sun Feb 24, 2008 1:25 pm

Re: View input as &quot;*&quot;
-----------------------------------
[url=http://java.sun.com/developer/technicalArticles/Security/pwordmask/]This may or may not help you.

Generally, you can't and don't do much manipulation with the command line shell. If you were making a professional program you would most likely be making an application, applet, or using third-party graphics where it would be easy to hide or replace input.

There is also an external API called JNI which gives you more control over the command line shell, but I have never used it.
