dcsimg
Interactive prompt based program: NO ECHO of PASSWORD string
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   johan_holtman
Posted On:   Friday, April 11, 2003 01:17 AM

I have to write a simple interactive character based program. It should ask for a password first. The typed characters should not be echo-ed. How can I do this?


The rest of the commands should normally be echo-ed.

Re: Interactive prompt based program: NO ECHO of PASSWORD string

Posted By:   Stephen_Ostermiller  
Posted On:   Friday, April 11, 2003 06:47 AM

There is no cross platform way to do this in Java.


You can only get data from System.in when the user presses the enter key. This means you can not react to each key stroke and hide it.


Native methods must be used for this purpose.


You might be able to find libraries that will work for you. Perhaps something like this: http://sourceforge.net/projects/javacurses/

About | Sitemap | Contact