Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set echo characters at console  RSS feed

 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we want that whatever input we give on console
it should display only characters like "*"
Is there any way to achieve this functionality
Suppose we want to have this functionality for passwords
Can any one pls give some hint as which class can help me out
Thnkx in advance
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gaurav,
As far as I know, this is difficult to do in pure java. This question is often asked in the java newsgroups. Perhaps a search of the newsgroups archives will help? Here are the results of two searches I did:
http://groups.google.com/groups?as_q=password&as_oq=console&ie=ISO-8859-1&as_ugroup=comp.lang.java*&lr=lang_en&hl=en
http://groups.google.com/groups?q=stty+group:comp.lang.java*+author:Beaton&hl=en&lr=lang_en&ie=UTF-8&start=10&sa=N
Also, this article from the Java Developer Connection (JDC) may also be helpful:
http://java.sun.com/features/2002/09/pword_mask.html
Here is an example (from Real Gagnon's Web site) that is similar to what is suggested in the JDC article:
http://www.rgagnon.com/javadetails/java-0375.html
Just replace this:

with this:

Hope this helps.
Good Luck,
Avi.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!