Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passwords

Status
Not open for further replies.

Casbah

Programmer
May 18, 2004
31
IE
Im writing a simple java program that runs in the command window. At the beginning the user is asked to enter a username and password, is there a way to turn echo off for the password or make stars or something come up so that the password doesnt appear in the command window?
Thanks, Conor
 
You can get funny using control characters, but I doubt you
will get this to run in a cross-application way.

I would allow an optional command line parameter
"-password xyz" for usage in scripts, and for interactive use
a parameter "-prompt" which will open a AWT window or
JOptionPane request prompting with a JPasswordField.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top