如何在这些代码里放入 密码验证??
import java.awt.EventQueue; import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
public class sky { private JFrame frame;
private JTextField textField;
private JTextField textField_1; /**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
sky window = new sky();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} /**
* Create the application.
*/
public sky() {
initialize();
} /**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setTitle("\u767B\u9646\u754C\u9762");
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JLabel lblNewLabel = new JLabel("\u9152\u5E97\u7BA1\u7406\u9910\u996E\u7CFB\u7EDF");
lblNewLabel.setBounds(147, 51, 113, 28);
frame.getContentPane().add(lblNewLabel);
textField = new JTextField();
textField.setBounds(147, 118, 113, 21);
frame.getContentPane().add(textField);
textField.setColumns(10);
textField_1 = new JTextField();
textField_1.setBounds(147, 168, 97, 21);
frame.getContentPane().add(textField_1);
textField_1.setColumns(10);
JLabel label = new JLabel("\u5DE5\u53F7");
label.setBounds(71, 121, 54, 15);
frame.getContentPane().add(label);
JLabel label_1 = new JLabel("\u5BC6\u7801");
label_1.setBounds(71, 171, 54, 15);
frame.getContentPane().add(label_1);
JButton button = new JButton("\u91CD\u7F6E");
button.setBounds(87, 212, 93, 23);
frame.getContentPane().add(button);
JButton button_1 = new JButton("\u767B\u9646");
button_1.setBounds(227, 212, 93, 23);
frame.getContentPane().add(button_1);
} }