Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Password

password = JOptionPane.showInputDialog( "Enter Password" );
if (password.equals("agent"))
{
startAgent(); frame.setVisible(false); break;
}
else
{
JOptionPane.showMessageDialog(null, "Incorrect Password.", "Error", JOptionPane.WARNING_MESSAGE); break;
}

I have a simple password validation code here, and I want to have the password shown as **** - how can I do that please?
[417 byte] By [hshah] at [2007-11-11 8:04:00]
# 1 Re: Password
The only way I can think of is to design a custom form with a JPasswordField ( http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JPasswordField.html) on it
Nathan87 at 2007-11-11 22:36:29 >