package com.view;
import java.awt.BorderLayout;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.*;
import com.data.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
public class IntegrationView extends JFrame{
//菜单组件
JMenuBar mBar;
JMenu JM1,JM2;
JMenuItem JMI1,JMI2,JMI3,JMI4,JMI5,JMI6,JMI7,JMI8;
//面板组件
JPanel JP1 = new JPanel();
//各功能面板
AddStudentView addStudentView = new AddStudentView();
SearchStudentInformationView searchStudentInformationView = new SearchStudentInformationView();
DelStudentImformationView DelStudentImformationView = new DelStudentImformationView();
UpdataStudentView UpdataStudentView = new UpdataStudentView();
ChangePasswordView ChangePasswordView = new ChangePasswordView();
DelAccountView DelAccountView = new DelAccountView();
DataImportMysql DataImportMysql;
public IntegrationView(){ //学生登录构造方法
//背景设置
String imgePath = "backgroup.jpg";
JPanel p1;
Image img = Toolkit.getDefaultToolkit().createImage(imgePath);
p1=new JPanel(){
protected void paintChildren(Graphics g) {
g.drawImage(img,0,0,this);
super.paintChildren(g);
}
};
add(p1,BorderLayout.CENTER);
setIconImage(Toolkit.getDefaultToolkit().createImage("backgound2.gif"));
mBar = new JMenuBar();
JM1 = new JMenu("功能选择");
JM2 = new JMenu("账号设置");
setJMenuBar(mBar);
mBar.add(JM1);
mBar.add(JM2);
JMI3 = new JMenuItem("查询学生信息");
JMI5 = new JMenuItem("退出登录");
JM1.add(JMI3);
JM1.addSeparator();
JM1.add(JMI5);
JMI6 = new JMenuItem("修改密码");
JM2.add(JMI6);
JM1.addSeparator();
JMI3.addActionListener(new ActionListener() { //查询事件
public void actionPerformed(ActionEvent e) {
remove(p1); //移除面板上的所有对象
remove(addStudentView);
remove(searchStudentInformationView);
remove(DelStudentImformationView);
remove(UpdataStudentView);
remove(ChangePasswordView);
repaint(); //重建面板
add(searchStudentInformationView);
setVisible(true);
}
});
JMI5.addActionListener(e->{ //退出登录
int n = JOptionPane.showConfirmDialog(null, "确定退出", "标题",JOptionPane.YES_NO_OPTION);
if(n == 0)
{
dispose(); //关闭窗口
LoginView LoginView = new LoginView();
}
});
JMI6.addActionListener(e->{ //修改密码
remove(p1);
remove(addStudentView);
remove(searchStudentInformationView);
remove(DelStudentImformationView);
remove(UpdataStudentView);
remove(ChangePasswordView);
repaint();
add(ChangePasswordView);
setVisible(true);
});
setTitle("欢迎进入学生管理系统");
setBounds(100,100,1200,560);
validate();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public IntegrationView(int Power){ //教师登录构造方法
String imgePath = "backgroup.jpg";
JPanel p1;
Image img = Toolkit.getDefaultToolkit().createImage(imgePath);
p1=new JPanel(){
protected void paintChildren(Graphics g) {
g.drawImage(img,0,0,this);
super.paintChildren(g);
}
};
add(p1,BorderLayout.CENTER);
setIconImage(Toolkit.getDefaultToolkit().createImage("backgound2.gif"));
mBar = new JMenuBar();
JM1 = new JMenu("功能选择");
JM2 = new JMenu("账号设置");
setJMenuBar(mBar);
mBar.add(JM1);
mBar.add(JM2);
JMI1 = new JMenuItem("添加学生信息");
JMI2 = new JMenuItem("删除学生信息");
JMI3 = new JMenuItem("查询学生信息");
JMI4 = new JMenuItem("修改学生信息");
JMI8 = new JMenuItem("导入数据");
JMI5 = new JMenuItem("退出登录");
JM1.add(JMI1);
JM1.addSeparator();
JM1.add(JMI2);
JM1.addSeparator();
JM1.add(JMI3);
JM1.addSeparator();
JM1.add(JMI4);
JM1.addSeparator();
JM1.add(JMI8);
JM1.addSeparator();
JM1.add(JMI5);
JMI6 = new JMenuItem("修改密码");
JM2.add(JMI6);
JM2.addSeparator();
JMI7 = new JMenuItem("删除学生账号");
JM2.add(JMI7);
JM2.addSeparator();
JMI1.addActionListener(e-> { //添加学生
remove(p1);
remove(addStudentView);
remove(searchStudentInformationView);
remove(DelStudentImformationView);
remove(UpdataStudentView);
remove(ChangePasswordView);
remove(DelAccountView);
repaint();
add(addStudentView);
setVisible(true);
});
JMI2.addActionListener(new ActionListener() { //删除学生
public void actionPerformed(ActionEvent e) {
remove(p1);
remove(addStudentView);
remove(searchStudentInformationView);
remove(DelStudentImformationView);
remove(UpdataStudentView);
remove(ChangePasswordView);
remove(DelAccountView);
repaint();
add(DelStudentImformationView);
setVisible(true);
}
});
JMI3.addActionListener(new ActionListener() { //查询学生信息
public void actionPerformed(ActionEvent e) {
remove(p1);
remove(addStudentView);
remove(searchStudentInformationView);
remove(DelStudentImformationView);
remove(UpdataStudentView);
remove(ChangePasswordView);
remove(DelAccountView);
repaint();
add(searchStudentInformationView);
setVisible(true);
}
});
JMI4.addActionListener(new ActionListener() { //更新学生信息
public void actionPerformed(ActionEvent e) {
remove(p1);
remove(addStudentView);
remove(searchStudentInformationView);
remove(DelStudentImformationView);
remove(UpdataStudentView);
remove(ChangePasswordView);
remove(DelAccountView);
repaint();
add(UpdataStudentView);
setVisible(true);
}
});
JMI5.addActionListener(e->{ //退出登录
int n = JOptionPane.showConfirmDialog(null, "确定退出", "标题",JOptionPane.YES_NO_OPTION);
if(n == 0)
{
dispose();
LoginView LoginView = new LoginView();
}
});
JMI6.addActionListener(e->{ //修改密码
remove(p1);
remove(addStudentView);
remove(searchStudentInformationView);
remove(DelStudentImformationView);
remove(UpdataStudentView);
remove(ChangePasswordView);
remove(DelAccountView);
repaint();
add(ChangePasswordView);
setVisible(true);
});
JMI7.addActionListener(e->{ //删除账号
remove(p1);
remove(addStudentView);
remove(searchStudentInformationView);
remove(DelStudentImformationView);
remove(UpdataStudentView);
remove(ChangePasswordView);
remove(DelAccountView);
repaint();
add(DelAccountView);
setVisible(true);
});
JMI8.addActionListener(e->{ //数据导入
DataImportMysql DataImportMysql = new DataImportMysql();
if(DataImportMysql.PushExcelToMysql())
JOptionPane.showMessageDialog
(null,"导入成功","消息对话成功框", JOptionPane.WARNING_MESSAGE);
else
JOptionPane.showMessageDialog
(null,"导入失败","消息对话成功框", JOptionPane.WARNING_MESSAGE);
});
setTitle("欢迎进入学生管理系统");
setBounds(100,100,1200,560);
validate();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
学生成绩管理系统主要实现了 1、 登录验证账号信息 2、 学生注册、教师注册 3、 添加学生成绩信息 4、 修改学生成绩信息 5、 查询学生成绩信息 6、 删除学生成绩信息 7、 文件导入学生成绩信息 8、 学生账号管理 9、 密码修改 资料里含有源码以及实验报告下载导入即可用!
资源推荐
资源详情
资源评论










收起资源包目录

































































































共 80 条
- 1
资源评论


威威攻城狮
- 粉丝: 68
- 资源: 11
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制
