password hiding

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

[Webinar] Streamline your web hosting managementRegister Today

x
 
AMD_MANConnect With a Mentor Commented:

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
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
All Courses

From novice to tech pro — start learning today.