Click to See Complete Forum and Search --> : how hide the input?


past
03-17-2000, 02:46 AM
I am wring a console java application,get user`s keybord input by System.in
. I want to know how hide the user`s input ,etc.password?
thanks.

Brent Horne
03-18-2000, 05:37 AM
Try using the setEchoCharacter() method of class TextField
for example

TextField myText = new TextField(20);
myText.setEchoCharacter('*');

There's another method usable in subsequent versions of Java (beyond
1.02)...that's setEchoChar(char) --depending on which version you're
using.

Good luck
Brent

"past" <past@21cn.com> wrote:
>
>I am wring a console java application,get user`s keybord input by System.in
>. I want to know how hide the user`s input ,etc.password?
>thanks.

past
03-20-2000, 02:48 AM
Thanks.but i donot want to use GUI.just console.
"Brent Horne" <bhorne@usa.net> wrote:
>
>Try using the setEchoCharacter() method of class TextField
>for example
>
>TextField myText = new TextField(20);
>myText.setEchoCharacter('*');
>
>There's another method usable in subsequent versions of Java (beyond
>1.02)...that's setEchoChar(char) --depending on which version you're
>using.
>
>Good luck
>Brent
>
>"past" <past@21cn.com> wrote:
>>
>>I am wring a console java application,get user`s keybord input by System.in
>>. I want to know how hide the user`s input ,etc.password?
>>thanks.
>
>