The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > javax.swing.text  [49 examples] > JTextField  [3 examples]

e980. Creating a Password JTextField Component

When the user hits RETURN, the text field fires an action event.
    JPasswordField textfield = new JPasswordField("Initial Text");
    textfield.setEchoChar('#');
    textfield.addActionListener(actionListener);

 Related Examples
e979. Creating a JTextField Component
e981. Aligning the Text in a JTextField Component

See also: Actions and Key Bindings    Caret and Selection    Events    JEditorPane    JFormattedTextField    JTextArea    JTextComponent    JTextPane    Styles   


© 2002 Addison-Wesley.