Turning echo off in Java

Turning echo off in Java

Post by ctippu » Thu, 14 Jul 2005 04:29:38


Hi all,

I would like to prompt the user for a password and turn off echoing
what the user inputs ("stty echo off" command in unix). Is this
possible in Java?
I really appreciate any input.

Thanks,
Shekar Tippur
 
 
 

Turning echo off in Java

Post by Brzez » Thu, 14 Jul 2005 04:46:58

wto, 12 lip 2005 o 21:29 GMT, XXXX@XXXXX.COM napisaa):
>> I would like to prompt the user for a password and turn off echoing >> what the user inputs ("stty echo off" command in unix). Is this >> possible in Java? >> I really appreciate any input.

http://www.yqcomputer.com/ +hiding+password

check one of the links on top of the results...

Pozdrawiam
Brzezi
--
[ E-mail: XXXX@XXXXX.COM ][ The wise man seeks everything in ]
[ Ekg: #3781111 ][ himself; the ignorant man tries to get ]
[ LinuxUser: #249916 ][ everything from somebody else. ]

 
 
 

Turning echo off in Java

Post by Tim Tyle » Thu, 14 Jul 2005 07:29:14

Tim Slattery < XXXX@XXXXX.COM > wrote or quoted:



It does when reading characters on the command line.

I think the OP is looking for:

http://www.yqcomputer.com/
--
__________
|im |yler http://www.yqcomputer.com/ @XXXXX.COM Remove lock to reply.
 
 
 

Turning echo off in Java

Post by Thomas G. » Thu, 14 Jul 2005 08:47:10

Tim Tyler coughed up:



It's entirely possible that the OP was looking for something non-command
line based, but didn't know how to ask for it in swing/awt/etc.

But in any case, I think that the solution you provided is both clever *and*
hysterical!

You gotta love the heroic leaps of effort that you can find here and there.



--
Puzzle: You are given a deck of cards all face down
except for 10 cards mixed in which are face up.
If you are in a pitch black room, how do you divide
the deck into two piles (may be uneven) that each
contain the same number of face-up cards?
Answer (rot13): Sebz naljurer va gur qrpx, qrny bhg
gra pneqf naq syvc gurz bire.
 
 
 

Turning echo off in Java

Post by Tim Tyle » Thu, 14 Jul 2005 16:49:32

Thomas G. Marshall < XXXX@XXXXX.COM > wrote or quoted:



The URL covers that too:

``If you wish to provide a graphical login dialog box for your
application, you can use the AWT's TextField class, which is a text
component that allows editing of a single line of text. To mask the
password field, use the setEchoChar method. For example, to set the
echo char to an asterisk, you would do the following:

TextField password = new TextField(8);
password.setEchoChar('*');''

There's also a Swing version.


It's a real problem for those writing command line tools in Java.

Echoing passwords to the screen is simply not normally acceptable.

It's good that there's a way around the problem - even if it is ridiculous.
--
__________
|im |yler http://www.yqcomputer.com/ @XXXXX.COM Remove lock to reply.
 
 
 

Turning echo off in Java

Post by Gordon Bea » Thu, 14 Jul 2005 17:34:12


Does this help?

http://www.yqcomputer.com/

Nothing is preventing you from running stty from within your application.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
 
 

Turning echo off in Java

Post by Robert Kle » Thu, 14 Jul 2005 19:21:32


http://www.yqcomputer.com/

Only that it's not exactly portable... :-)

robert
 
 
 

Turning echo off in Java

Post by Gordon Bea » Thu, 14 Jul 2005 20:28:20


No such claims were made, however I'm confident that it's portable
enough for the OP!

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e