Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Textfield que muestre * en lugar de letras

303 views
Skip to first unread message

XiScO

unread,
Sep 11, 2001, 5:54:01 AM9/11/01
to
Hola!
Me gustaria saber como hacer que un textfield muestre asteriscos en
lugar de letras. O sea que quiero hacer un campo de tipo clave.
Gracias
--
Salu2,

********
Francisco Javier

chete

unread,
Sep 12, 2001, 3:41:06 AM9/12/01
to
Ese componente lo tienes en : javax.swing.JPasswordField
"XiScO" <fna...@gap.upv.es> escribió en el mensaje
news:3B9DDF39...@gap.upv.es...

.
.
.
.


XiScO

unread,
Sep 13, 2001, 5:25:06 AM9/13/01
to
chete wrote:
>
> Ese componente lo tienes en : javax.swing.JPasswordField
Gracias, pero no hay nada para AWT??

Jordi Miñana Estruch

unread,
Sep 14, 2001, 12:08:17 PM9/14/01
to
XiScO wrote:

> Hola!
> Me gustaria saber como hacer que un textfield muestre asteriscos en
> lugar de letras. O sea que quiero hacer un campo de tipo clave.

Para eso debes tilizar el método setEchoChar de TextField, te pongo lo
que viene en el API:

-----------------------------------------------------------
public void setEchoChar(char c)

Sets the echo character for this text field.

An echo character is useful for text fields where user input should
not be echoed to the screen, as in the case of a text field for entering
a password. Setting echoChar = 0 allows user input to be echoed to the
screen again.
Parameters:
c - the echo character for this text field.
Since:
JDK1.1
See Also:
echoCharIsSet(), getEchoChar()
------------------------------------------------------------

Saludos

0 new messages