package a;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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.Timer;
public class Main {
private static Timer t1 = new Timer(0, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
System.out.println(e.getSource());
System.out.println("t1");
}
});
private static Timer t2 = new Timer(0, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
System.out.println(e.getSource());
System.out.println("t2");
}
});
private static Timer t3 = new Timer(0, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
System.out.println(e.getSource());
System.out.println("t3");
}
});
private static Timer t4 = new Timer(0, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
System.out.println(e.getSource());
System.out.println("t4");
}
});
public static void main(String[] args) {
JFrame jf = new JFrame();
jf.setBounds(0, 0, 1000, 700);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf.setLayout(null);
jf.setResizable(false);
JLabel jl0 = new JLabel("登录窗口", SwingConstants.CENTER);
jl0.setBounds(0, 50, 1000, 100);
jl0.setFont(new Font("", Font.BOLD, 100));
jf.add(jl0);
JLabel jl1 = new JLabel("用户名");
jl1.setBounds(50, 200, 300, 100);
jl1.setFont(new Font("", Font.BOLD, 50));
jf.add(jl1);
JTextField jtf1 = new JTextField("管理员");
jtf1.setBounds(300, 200, 300, 100);
jtf1.setFont(new Font("", Font.BOLD, 50));
jf.add(jtf1);
JButton jb1 = new JButton("注册新用户");
jb1.setBounds(650, 200, 300, 100);
jb1.setFont(new Font("", Font.BOLD, 50));
jf.add(jb1);
JLabel jl2 = new JLabel("密码");
jl2.setBounds(50, 350, 300, 100);
jl2.setFont(new Font("", Font.BOLD, 50));
jf.add(jl2);
JPasswordField jpf = new JPasswordField(8);
jpf.setBounds(300, 350, 300, 100);
jpf.setFont(new Font("", Font.BOLD, 50));
jf.add(jpf);
JButton jb2 = new JButton("忘记密码");
jb2.setBounds(650, 350, 300, 100);
jb2.setFont(new Font("", Font.BOLD, 50));
jf.add(jb2);
JButton jb4 = new JButton("登录");
jb4.setBounds(300, 500, 300, 100);
jb4.setFont(new Font("", Font.BOLD, 50));
jf.add(jb4);
jb4.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println(1);
}
});
jf.setVisible(true);
}
}