password hiding

I am trying to hide the text in a textbox with *** when a password is entered ... any ideas?
knorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bgillbanksCommented:
This creates a password box called textfield... easy

<input type="password" name="textfield">
0
knorAuthor Commented:

a clearer view of what i am trying to do : i create a JTextField box that is associated with a password using this code
            temp_FramerB = new PARTSFramer(1, 187.826f+ (1*1200), 1685.522f + (count*330), 2666.609f , 313.043f, 136);
                                    ((PARTSFramerLayout)this.getContentPane().getLayout()).setFramer(tBox, temp_FramerB);
                                    this.getContentPane().add(tBox) ;
                                      tBox.setVisible(true);
                                       tBox.size();
                                       parameter.addElement(tBox);

What i want to do is allow the user to enter his/her password but replace each character that is entered as a * ie hiding the password
0
AMD_MANCommented:

Check this out:

http://web2.java.sun.com/docs/books/tutorial/uiswing/components/textfield.html

It states:

"If you need to provide a password field -- an editable text field that doesn't show the characters the user types -- use the JPasswordField class instead. This section discusses both text fields and password fields."

Later,
AMD_MAN
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

boycey19Commented:
tBox.setEchoChar('*');

Boycey19
0
AMD_MANCommented:

The tBox.setEchoChar('*');  solution won't work as is.  First the tbox must be a JPasswordField.

Check out:

http://web2.java.sun.com/products//jdk/1.3/docs/api/javax/swing/JTextField.html

It states:

"The method setEchoChar and getEchoChar are not provided directly to avoid a new implementation of a pluggable look-and-feel inadvertantly exposing password characters. To provide password-like services a seperate class JPasswordField extends JTextField to provide this service with an independantly pluggable look-and-feel."

AMD_MAN
0
knorAuthor Commented:
Great - it works a treat - =) Thanx
0
AMD_MANCommented:

You are welcome!

AMD_MAN
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.