Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds


  Asked By: Kiswar    Date: Jan 14    Category: Java    Views: 568

I'm designing a program which requires the usser to input a password.
Now the problem is that it is an apllication and not an applet. Now
ehen the user enters the password, all that should be displayed on
the screen should be * or nothing at all. How do I doe this? A
example would be useful.



5 Answers Found

Answer #1    Answered By: Randy Warren     Answered On: Jan 14

Are you using swing? Use a JPasswordField.

Answer #2    Answered By: Frederick Greene     Answered On: Jan 14

But isn't swing used for applets? I want an aplpication not an

Answer #3    Answered By: Kelly Bell     Answered On: Jan 14

You can use Swing to make an application.

Answer #4    Answered By: Angel Harris     Answered On: Jan 14

JPasswordField passwordField = new JPasswordField(8);

add the passwordField to your JFrame or JPanel, etc.....

String password  = new String(passwordField.getPassword());

Answer #5    Answered By: Cheri Garcia     Answered On: Jan 14

Swing can be used in both applications and applets.

Didn't find what you were looking for? Find more on password Or get search suggestion and latest updates.