View input as "*"
Author |
Message |
uberwalla
|
Posted: Sun Feb 24, 2008 11:50 am Post subject: View input as "*" |
|
|
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. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
HeavenAgain
|
Posted: Sun Feb 24, 2008 1:12 pm Post subject: RE:View input as "*" |
|
|
it is impossible to do that with Scanner, however you can use the swing class' JPasswordField |
|
|
|
|
|
richcash
|
Posted: Sun Feb 24, 2008 1:25 pm Post subject: Re: View input as "*" |
|
|
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. |
|
|
|
|
|
|
|