📄 framforadmin.java
字号:
package E4;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Vector;
import java.io.File;
import java.io.*;
import java.util.StringTokenizer;
import java.sql.*;
//管理员界面
class framForAdmin implements ActionListener{
updatePassword up;
JDialog jdl;
JPanel jpl=new JPanel();
JLabel welcomLabel = new JLabel("欢迎您,管理员",JLabel.CENTER);
JButton updateInfo = new JButton("查看信息");
JButton updatePassword = new JButton("修改密码");
JButton insertInfo = new JButton("添加学生信息");
JButton exitBtn = new JButton("退出");
studentStatus sst;
framForAdmin(JFrame f,String s,boolean b){
jdl=new JDialog(f,s,b);
up=new updatePassword(f,"管理员密码修改",b);
sst=new studentStatus(f,"学生综合管理",b);
jdl.setSize(350,180);
jdl.setLocation(350,240);
jdl.setResizable(false);
jdl.addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e)
{
jdl.setVisible(false);
}});
jdl.add(welcomLabel,BorderLayout.NORTH);
jpl.add(new JLabel(""));
jpl.add(new JLabel(""));
jpl.add(updateInfo);
jpl.add(updatePassword);
jpl.add(exitBtn);
jpl.setLayout(new FlowLayout(FlowLayout.LEFT,15,15));
//jpl.setLayout(new GridLayout(3,2,5,5));
jdl.add(jpl);
insertInfo.addActionListener(this);
updateInfo.addActionListener(this);
updatePassword.addActionListener(this);
exitBtn.addActionListener(this);
}
void setDisplay(Boolean tf){
jdl.setVisible(tf);
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==insertInfo){
}
else if(e.getSource()==updateInfo){
sst.setDisplay(true);
}
else if(e.getSource()==updatePassword){
up.setID("system");
up.setState(0);
up.setDisplay(true);
}
else if(e.getSource()==exitBtn){
jdl.setVisible(false);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -