📄 mainwindow2.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.sql.*;
class MainWindow2 extends MainWindow implements ActionListener
{//管理员界面
JButton button1,button2,button3,button4,button5,button6,button7;
public MainWindow2(String s){
super(s,2);
setLayout(null);
button1=new JButton("添加新的学生记录");
button2=new JButton("添加课程");
button3=new JButton("删除有关记录");
button4=new JButton("添加/删除用户");
button5=new JButton("显示数据库的表");
button6=new JButton("添加/修改任课教师");
button7=new JButton("退出系统");
add(button1);add(button2);add(button3);
add(button4);add(button5);add(button6);
add(button7);
button1.setBounds(50,50,200,30);
button2.setBounds(50,100,200,30);
button3.setBounds(50,150,200,30);
button4.setBounds(50,200,200,30);
button5.setBounds(50,250,200,30);
button6.setBounds(50,300,200,30);
button7.setBounds(50,350,200,30);
button1.addActionListener(this);
button2.addActionListener(this);
button3.addActionListener(this);
button4.addActionListener(this);
button5.addActionListener(this);
button6.addActionListener(this);
button7.addActionListener(this);
psd.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
if (e.getSource()==button1)
{
new Insert(); //插入新学生
}
else if (e.getSource()==button2)
{
new Insert2(); //插入课程
}
else if (e.getSource()==button3)
{
new Del(); //删除学生记录
}
else if (e.getSource()==button4)
{
new User(); //添加用户
}
else if (e.getSource()==button5)
{
new Display(); //显示表中的内容
}
else if (e.getSource()==button6)
{
new Add2();
}
else if (e.getSource()==psd)
{
new ChangePass(s);
}
else if (e.getSource()==button7)
{
System.exit(0); //退出系统
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -