package frame;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class Manager extends JFrame implements ActionListener{
JLabel welcome,option;
JButton student,teacher,research;
Manager(){
init();
}
void init(){
welcome = new JLabel("欢迎您,管理员");
option = new JLabel("请选择");
student=new JButton("研究生管理");
teacher=new JButton("导师信息管理");
research=new JButton("科研项目管理");
student.addActionListener(this);
teacher.addActionListener(this);
research.addActionListener(this);
welcome.setFont(new java.awt.Font("Dialog", 1, 25));
option.setFont(new java.awt.Font("Dialog", 1, 20));
JPanel jp1 = new JPanel();
JPanel jp2 = new JPanel();
JPanel jp3 = new JPanel();
JPanel jp4 = new JPanel();
jp1.setLayout(new BorderLayout());
jp2.setLayout(new FlowLayout());
jp3.setLayout(new FlowLayout());
jp4.setLayout(new FlowLayout());
jp2.add(welcome);
jp3.add(option);
jp4.add(student);
jp4.add(teacher);
jp4.add(research);
jp1.add(jp2,"North");
jp1.add(jp3,"Center");
jp1.add(jp4,"South");
this.add(jp1);
setBounds(200,200,400,300);
setVisible(true);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setTitle("管理员跳转页面");
}
public void actionPerformed(ActionEvent e) {
String buttonName = e.getActionCommand();
System.out.println(buttonName);
if(buttonName.equals("研究生管理")){
new Test3();
}
else if(buttonName.equals("导师信息管理")){
new Teacher();
}
else if(buttonName.equals("科研项目管理")){
new Project();
}
}
public static void main(String args[]){
new Manager();
}
}