This method prompts the user to enter the password and attempts
to mask inputs with "".
//password holder
String password = "";
final MaskingThread maskingThread = new MaskingThread(prompt);
final Thread thread = new Thread(maskingThread);
thread.start();
//block until enter is pressed;
while (true)
{
char ch = (char)InputsAndOutputs.getInstance().getUserInput().getChar();
//char ch = (char)System.in.read();
//assume enter pressed, stop masking
maskingThread.stopMasking();
if (ch == '\r") break;
else if (ch == '\n") break;
else
{
//store the password
password += ch;
}
}
InputsAndOutputs.getInstance().getUserOutput().println("");
return password;