用JPasswordFiledjavax.swing 
Class JPasswordField
java.lang.Object
  |
  +-java.awt.Component
        |
        +-java.awt.Container
              |
              +-javax.swing.JComponent
                    |
                    +-javax.swing.text.JTextComponent
                          |
                          +-javax.swing.JTextField
                                |
                                +-javax.swing.JPasswordFieldJPasswordField is a lightweight component that allows the editing of a single line of text where the view indicates something was typed, but does not show the original characters. JPasswordField is intended to be source-compatible with java.awt.TextField used with echoChar set. It is provided separately to make it easier to safely change the UI for the JTextField without affecting password entries.