importjava.awt.GridLayout;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjava.util.ArrayList;
importjava.util.List;
importjavax.swing.JButton;
importjavax.swing.JFrame;
importjavax.swing.JLabel;
importjavax.swing.JOptionPane;
importjavax.swing.JPasswordField;
importjavax.swing.JTextField;
//登录窗体类
publicclassMainextendsJFrameimplementsActionListener,Runnable{
privatestaticfinallongserialVersionUID=1L;
protectedJLabellblPrompt,lblTime,lblUserName,lblPassword;
protectedJTextFieldtxtUserName;
protectedJPasswordFieldtxtPassword;
protectedJButtonbtnLogin,btnRegister;
protectedstaticThreadthread=null;
publicstaticvoidmain(String[]args){
Data.init();
MainfrmLogin=newMain();
thread=newThread(frmLogin);
thread.start();
}
publicMain(){
super("用户登录");
initComponent();
}
//初始化控件
publicvoidinitComponent(){
lblPrompt=newJLabel("登录剩余时间(秒):");
lblTime=newJLabel("60");
lblUserName=newJLabel("用户名:");
lblPassword=newJLabel("密码:");
txtUserName=newJTextField(10);
txtPassword=newJPasswordField(10);
btnLogin=newJButton("登录");
btnRegister=newJButton("注册");
btnLogin.addActionListener(this);
btnRegister.addActionListener(this);
this.setLayout(newGridLayout(4,2));
this.add(lblPrompt);
this.add(lblTime);
this.a