Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to read value of a JPasswordField ?

Status
Not open for further replies.

frag

Programmer
Dec 7, 2000
321
GB
Hi everybody!

I don't know how to get the value of a JPasswordField!!
I've tried the field's method "getPassword()" but it deliveres an array of characters (char[]). I don't know how to get the lenght of this array! I have to store the value of the JPasswordField in a string-value.

Can anybody help me, please?

thanx!

frag patrick.metz@epost.de
 
Hi.

If you want to get the length of the returned array just do this :

{
...
editPass.getPassword().length;//where editPass is an
//instance of JPasswordField
...
}

More generaly, the size of an array can be get by the length attribute.

Bye.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top