📄 mainwindow3.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.sql.*;
class MainWindow3 extends MainWindow implements ActionListener{
//用户界面
JButton button1,button2,button3,button4;
public MainWindow3(String s){
super(s,3);
setLayout(null);
Image Background = Toolkit.getDefaultToolkit().getImage("icon3.jpg");
this.getGraphics().drawImage(Background,0,0,getWidth(),getHeight(),this);
//添加按钮
button1=new JButton("选课/撤消");
button2=new JButton("显示个人信息");
button3=new JButton("修改个人信息");
button4=new JButton("退出系统");
add(button1);
add(button2);
add(button3);
add(button4);
button1.setBounds(50,50,200,30);
button2.setBounds(50,100,200,30);
button3.setBounds(50,150,200,30);
button4.setBounds(50,200,200,30);
//注册监听事件
button1.addActionListener(this);
button2.addActionListener(this);
button3.addActionListener(this);
button4.addActionListener(this);
psd.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==button1)
new Insert3(s);
if(e.getSource()==button2)
new Display4(s);
if (e.getSource()==psd)
new ChangePass(s);
if (e.getSource()==button3)
{
new ChangePersonInformation(s);
}
if(e.getSource()==button4)
System.exit(0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -