Java JPasswordField class
import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JPasswordField; class Demo extends JPanel { public Demo() { setLayout(new FlowLayout()); /*from w w w. ja v a 2 s . co m*/ JPasswordField passwordField = new JPasswordField(10); add(passwordField); } } public class Main { public static void main(String[] args) { Demo panel = new Demo(); JFrame application = new JFrame(); application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); application.add(panel); application.setSize(250, 250); application.setVisible(true); } }