Re: JPasswordField GetPassword method.

From: Christophe Vanfleteren (c.v4nfl3t3r3n_at_pandora.be)
Date: 02/28/04


Date: Sat, 28 Feb 2004 08:30:30 GMT

Max wrote:

> Hi all,
> I'm using the JPasswordField to get the user insert password. Previously
> it uses getText() to retrieve the password, but now the getText() for
> JPasswordField has been deprecated, the getPassword is recommended
> instead. But i have no idea how to retrieve the data from the
> JPasswordField.
>
> Do anyone have any idea?
>
> Thanks and Regards,
>
> Max.

Err, how about using getPassword() ?
It gives you a char array. You can then either create a String with it (not
recommended for the same reason getText() is deprecated), or compare it
with another char array, that you can create using
"correctpassword".toCharArray().

-- 
Kind regards,
Christophe Vanfleteren


Relevant Pages

  • JPasswordField GetPassword method.
    ... uses getText() to retrieve the password, ... JPasswordField has been deprecated, ... But i have no idea how to retrieve the data from the JPasswordField. ... Thanks and Regards, ...
    (comp.lang.java.gui)
  • Re: Hello out there...
    ... can you use GETTEXT to retrieve a telephone ... > number after the phrase: ... > I cannot hardcode. ...
    (microsoft.public.dotnet.languages.vb)