📄 guanliyuan.java
字号:
import java.awt.*;
import java.sql.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
public class guanliyuan extends JFrame implements ActionListener
{
Connection con;
ResultSet rs;
Statement st;
JButton button1,button2,button3,button4;
public void guanliyuan()
{
button1=new JButton("学生管理");
button1.addActionListener(this);
button2=new JButton("课程管理");
button2.addActionListener(this);
button3=new JButton("成绩管理");
button3.addActionListener(this);
button4=new JButton("退出管理");
button4.addActionListener(this);
Box box1=Box.createHorizontalBox();
box1.add(new JLabel("管理员管理页面",JLabel.CENTER));
Box box2=Box.createHorizontalBox();
box2.add(button1);
box2.add(new JLabel(" 对学生信息进行管理",JLabel.CENTER));
Box box3=Box.createHorizontalBox();
box3.add(button2);
box3.add(new JLabel(" 对课程信息进行管理",JLabel.CENTER));
Box box4=Box.createHorizontalBox();
box4.add(button3);
box4.add(new JLabel(" 对学生成绩进行管理",JLabel.CENTER));
Box box5=Box.createHorizontalBox();
box5.add(button4);
box5.add(new JLabel(" 退出管理员管理页面",JLabel.CENTER));
Box boxH=Box.createVerticalBox();
boxH.add(box1);
boxH.add(box2);
boxH.add(box3);
boxH.add(box4);
boxH.add(box5);
JPanel pCenter=new JPanel();
pCenter.add(boxH);
setLayout(new BorderLayout());
add(pCenter,BorderLayout.CENTER);
setVisible(true);
setBounds(100,50,300,200);
validate();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==button1)
{xueshengguanli xsgl=new xueshengguanli();
xsgl.setBounds(200,150,100,100);
xsgl.xueshengguanli();
xsgl.setVisible(true);
}
if(e.getSource()==button2)
{kechengguanli kcgl=new kechengguanli();
kcgl.setBounds(200,150,100,100);
kcgl.kechengguanli();
kcgl.setVisible(true);
}
if(e.getSource()==button3)
{chengjiguanli cjgl=new chengjiguanli();
cjgl.setBounds(200,150,100,100);
cjgl.chengjiguanli();
cjgl.setVisible(true);
}
if(e.getSource()==button4){System.exit(0);}
}
public static void main(String args[])
{
new guanliyuan();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -