Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2005

Tip: Looking for answers? Try searching our database.

Turning echo off in Java

Thread view: 
ctippur@gmail.com - 12 Jul 2005 20:29 GMT
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
Brzezi - 12 Jul 2005 20:46 GMT
wto, 12 lip 2005 o 21:29 GMT, ctippur@gmail.com napisał(a):

> 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.google.com/search?q=java+hiding+password

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

Pozdrawiam
    Brzezi
Signature

[    E-mail: brzezi@enter.net.pl ][  The wise man seeks everything in         ]
[       Ekg: #3781111            ][  himself; the ignorant man tries to get   ]
[ LinuxUser: #249916             ][  everything from somebody else.           ]

Tim Slattery - 12 Jul 2005 21:10 GMT
>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?

Huh? This is a programming language, not an OS shell. It doesn't write
anything out unless you tell it to.

--
Tim Slattery
Slattery_T@bls.gov
Tim Tyler - 12 Jul 2005 23:29 GMT
Tim Slattery <Slattery_T@bls.gov> wrote or quoted:

> >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?
>
> Huh? This is a programming language, not an OS shell. It doesn't write
> anything out unless you tell it to.

It does when reading characters on the command line.

I think the OP is looking for:

http://java.sun.com/features/2002/09/pword_mask.html
Signature

__________
|im |yler  http://timtyler.org/  tim@tt1lock.org  Remove lock to reply.

Thomas G. Marshall - 13 Jul 2005 00:47 GMT
Tim Tyler coughed up:
> Tim Slattery <Slattery_T@bls.gov> wrote or quoted:
>
[quoted text clipped - 10 lines]
>
> http://java.sun.com/features/2002/09/pword_mask.html

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.

Signature

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.

Tim Tyler - 13 Jul 2005 08:49 GMT
Thomas G. Marshall <tgm2tothe10thpower@replacetextwithnumber.hotmail.com> wrote or quoted:
> Tim Tyler coughed up:
> > Tim Slattery <Slattery_T@bls.gov> wrote or quoted:

> >>> 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
[quoted text clipped - 11 lines]
> 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.

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.

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

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.
Signature

__________
|im |yler  http://timtyler.org/  tim@tt1lock.org  Remove lock to reply.

Gordon Beaton - 13 Jul 2005 09:34 GMT
> 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?

Does this help?

http://groups-beta.google.com/group/comp.lang.java.programmer/msg/a132c7feda18187a

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

/gordon

Signature

[  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

Robert Klemme - 13 Jul 2005 11:21 GMT
>> 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?
>
> Does this help?

http://groups-beta.google.com/group/comp.lang.java.programmer/msg/a132c7feda18187a

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

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

   robert
Gordon Beaton - 13 Jul 2005 12:28 GMT
> Only that it's not exactly portable... :-)

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

/gordon

Signature

[  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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.