publicclassLoginextendsFrameimplementsActionListener{Labellbuser,lbpwd;Labellbinstrution=newLabel("抱歉,该用户名不存在!");Labellbinstrution1=newLabel("抱歉,该用户口令不正...
public class Login extends Frame implements ActionListener
{
Label lbuser,lbpwd;
Label lbinstrution=new Label("抱歉,该用户名不存在!");
Label lbinstrution1=new Label("抱歉,该用户口令不正确!");
TextField tfuser,tfpwd;
Button btn1,btn2;
String s1,s2;//用来取文本框中的字符串.
JLabel lbwhole;
public Login()
{
super("考生登录系统界面");
setBounds(340,190,600,300);
setLayout(null);
Icon icon = new ImageIcon("G:/11.jpg"); //添加全景图
JLabel lbwhole=new JLabel(icon);
lbinstrution.setFont(new Font("华文行楷",Font.BOLD,14));
lbinstrution1.setFont(new Font("华文行楷",Font.BOLD,14));
lbuser=new Label("用户名",Label.CENTER);
lbuser.setFont(new Font("华文行楷",Font.BOLD,12));
lbpwd=new Label("口 令",Label.CENTER);
lbpwd.setFont(new Font("华文行楷",Font.BOLD,12));
//lbuser.setOpaque(true);
lbuser.setBackground(Color.red);
tfuser=new TextField(16);
tfpwd=new TextField(16);
tfpwd.setEchoChar('*');
btn1=new Button("登录");
btn1.setForeground(Color.red);
btn1.setFont(new Font("华文行楷",Font.BOLD,12));
btn1.setBackground(new Color(213,219,246));
btn2=new Button("注册");
btn2.setForeground(Color.red);
btn2.setFont(new Font("华文行楷",Font.BOLD,12));
btn2.setBackground(new Color(213,219,246));
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
dispose();
System.exit(0);
}
展开