Creating a password field in Java


JPasswordField is the Swing Password in Java. Just like the other javax.swing Components it’s a JavaBean. Here’s how to implement it:

JPasswordField textfield = new JPasswordField("Initial Text");


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.