Diseño Avanzado de Interfaz Grafica de Usuario con SWING JPasswordField
Definición En Java existe un componente Swing para tratar con passwords llamado JPasswordField. Es un campo de texto que guarda la contraseña entrada en forma de un array de caracteres (char), es decir los convierte en * para que no sean entendidos por usuarios no autorizados.
¿Dónde se encuentra? import javax.swing.* import javax.swing.JPasswordField; javax.swing.JPasswordField objeto = new javax.swing.JPasswordField();
Constructores Constructor Summary JPasswordField() Constructs a new JPasswordField, with a default document, null starting text string, and 0 column width. JPasswordField(Document doc, String txt, int columns) Constructs a new JPasswordField that uses the given text storage model and the given number of columns. JPasswordField(int columns) Constructs a new empty JPasswordField with the specified number of columns. JPasswordField(String text) Constructs a new JPasswordField initialized with the specified text. JPasswordField(String text, int columns) Constructs a new JPasswordField initialized with the specified text and columns.
Creando Objetos JPasswordField JPasswordField jpwName = new JPasswordField(); this.add (jpwName) ;
Métodos del JPasswordField