Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 View input as "*"
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
uberwalla




PostPosted: 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
Sponsor
sponsor
HeavenAgain




PostPosted: 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




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: