Hi,
Thank you very much.
But I have a small problem.If I am running the example programs from the command prompt its working fine.But when I am running from eclipse its printingn the prompt continuously.
One another similar program which I got is here.
If I run this from eclise and enter any key in console the eclipse window will get closed.Why is it so?
The code is here:
import java.io.*;
import java.awt.*;
public class PwdConsole {
public static void main(
String[] args) throws Exception {
ConsoleEraser consoleEraser = new ConsoleEraser();
System.out.print("Password? ");
BufferedReader stdin = new BufferedReader(new InputStreamReader(
System.in));
consoleEraser.start();
String pass = stdin.readLine();
consoleEraser.halt();
System.out.print("\b");
System.out.println("Password: '" + pass + "'");
}
}
class ConsoleEraser extends
Thread {
private boolean running = true;
public void run() {
while (running) {
System.out.print("\b ");
}
}
public synchronized void halt() {
running = false;
}
}
Regards
Rajasree