import javax.swing.*;
public class jText_Test extends JFrame {
    JTextField textname = new JTextField("输入姓名");
    JTextField textreset = new JTextField("我是一个文本框", 10);
    JPasswordField jPasswordField1 = new JPasswordField();
    public jText_Test() {
         setLayout(null);
         textname.setBounds(43, 71, 123, 26);
         textreset.setText("重新设置了文本");
         textreset.setBounds(44, 28, 121, 27);
         jPasswordField1.setEchoChar('#');
         this.setTitle("文本框");
         add(textreset);
         add(textname);
         jPasswordField1.setText("jPasswordField1");
         jPasswordField1.setBounds(49, 114, 81, 25);
         add(jPasswordField1);
    }
    public static void main(String args[]) {
        jText_Test tx = new jText_Test();
        tx.setBounds(200, 200, 250, 200);
        tx.validate();
        tx.setVisible(true);
    } 
}   





