I am creating a GUI program to simulate User Account creations similar to Windows.
I have created a GUI and I have 2 text areas. 1 for Usernames and 1 for Passwords.
I was wondering how can I get the password area to display asterisks or dots (like Windows XP) rather than the actual text.
Thanks in Advance
Instead of using a JTextField, use a JPasswordField. The Java API has complete documentation, but to summarize, you can call setEchoChar(char) on the JPasswordField object to set the character that you would like to display in place of the typed characters. Retrieve the typed characters by calling getPassword(). This returns the characters typed in the JPasswordField object as a char. Because this is a password, you may not want to leave this hanging around in memory for a long time. You might want to fill the char with some other contents after you are done using it.
Thanks Chris, I've managed to solve that problem but I've come across another 2 problems, hopefully its the last!
I have 5 classes: (Attached)
The program starts off by running the Login Screen and prompting for a username and password, I've set one up as "Abid" for username and "Password" for the password.
This allows you into the creation screen, where users are created and stored into a Hashtable.
Now what I'd like to do is be able to allow the user to login via the Hashtable Set of users, however, I'm not sure of this, anyone got any ideas how I could go about this?
Second Problem, In my creation screen, I have set up a scroll pane to go with the DisplayArea, however, I still can't seem be able to get the scroll pane to work?
Any help is much appreciated!
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL