📄 mainwindow1.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.sql.*;
class MainWindow1 extends MainWindow implements ActionListener{
//用户界面
JButton button2,button4,button6;
public MainWindow1(String s){
//添加按钮
super(s,1);
setLayout(null);
button2=new JButton("查询记录");
button4=new JButton("添加成绩");
button6=new JButton("退出系统");
add(button2);
add(button4);
add(button6);
button2.setBounds(250,250,200,30);
button4.setBounds(250,300,200,30);
button6.setBounds(250,350,200,30);
//注册监听事件
button2.addActionListener(this);
button4.addActionListener(this);
button6.addActionListener(this);
psd.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
if (e.getSource()==button2)
{
new Sercher(); //查找学生
}
else if (e.getSource()==button4)
{
new Add(); //添加成绩
}
else if (e.getSource()==button6)
{
System.exit(0); //退出系统
}
else if (e.getSource()==psd)
{
new ChangePass(s);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -