-
how hide the input?
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.
-
Re: how hide the input?
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.
-
Re: how hide the input?
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.
>
>
-
The console input comes with a readPassword() method, that should work to cover the users input. The info on it can be found here:
http://download.oracle.com/javase/6/docs/api/java/io/Console.html
Hope this helps!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks