登陆的代码如下
package denglu;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.plaf.basic.BasicButtonUI;
import com.swtdesigner.SwingResourceManager;
public class DengLu extends JFrame{
private JPasswordField pass;
private static JTextField name;
public void DengLu() {
this.setTitle("登入窗口");
//设置登入窗口的属性参数
getContentPane().setLayout(null);
setSize(453, 317);
final JLabel label = new JLabel();
label.setHorizontalAlignment(SwingConstants.CENTER);
label.setForeground(new Color(128, 128, 0));
label.setFont(new Font("华文彩云", Font.BOLD, 48));
label.setText("学生管理系统");
label.setBounds(0, 0, 447, 77);
getContentPane().add(label);
final JLabel label_1 = new JLabel();
label_1.setForeground(new Color(128, 128, 0));
label_1.setFont(new Font("", Font.BOLD, 22));
label_1.setText("用 户 名:");
label_1.setBounds(56, 101, 122, 32);
getContentPane().add(label_1);
final JLabel label_1_1 = new JLabel();
label_1_1.setForeground(new Color(255, 255, 255));
label_1_1.setFont(new Font("", Font.BOLD, 22));
label_1_1.setText("密 码:");
label_1_1.setBounds(56, 154, 122, 32);
getContentPane().add(label_1_1);
name = new JTextField();//用户名输入框
name.setBounds(205, 105, 155, 32);
getContentPane().add(name);
pass = new JPasswordField();//密码输入框
pass.setBounds(205, 158, 155, 32);
pass.addKeyListener(new Key());//添加键盘监听
getContentPane().add(pass);
final JButton button_1 = new JButton();
button_1.setForeground(new Color(255, 255, 255));
//设置按钮的事件处理
button_1.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent arg0) {
/*String s
1