Login Simulation


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Login Simulation

  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Login Simulation

    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

    Zoom7000

  2. #2
    Join Date
    Dec 2003
    Posts
    2
    Hello Zoom7000,

    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.

    --Chris Nauroth

  3. #3
    Join Date
    Nov 2003
    Posts
    2
    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)

    LoginStart.java
    CreationScreen.java
    Users.java
    UsersTable.java
    InvalidUserIdException.java

    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!

    Zoom7000
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center