⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminframe.java

📁 综合测评管理系统——完成班级的综合测评工作
💻 JAVA
字号:
import java.sql.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class AdminFrame{
	JFrame mainframe;
	String current_usertype="";
	String current_username="";
		
	public AdminFrame(String username){
		//当前用户的名字、类型
		current_username=username;
		//current_usertype=usertype;
		//System.out.println(usertype);
		//根据用户的类型创建的不同的主界面
		mainframe=new JFrame("LoginDemo");
		Container contentPane=mainframe.getContentPane();
		JPanel buttonPanel=new JPanel();
		
		//菜单设置
		JMenuBar menu_bar=new JMenuBar();
		menu_bar.setOpaque(true);
		//菜单项-系统设置
		JMenu sysconfig=new JMenu("系统设置");
		
		JMenuItem password_modify=new JMenuItem("修改密码");
		JMenuItem user_manager=new JMenuItem("用户管理");
		JMenuItem login_off=new JMenuItem("注销登录");
		JMenuItem system_exit=new JMenuItem("退出");
		
		sysconfig.add(password_modify);
		sysconfig.add(user_manager);
		sysconfig.add(login_off);
		sysconfig.add(system_exit);
		
		//菜单项-班级管理
		JMenu classmanager=new JMenu("班级管理");
		
		JMenuItem parameter_config=new JMenuItem("参数设置");
		JMenuItem add_delete=new JMenuItem("添加/删除");
		JMenuItem course_manager=new JMenuItem("课程管理");
		JMenuItem colligate_info=new JMenuItem("综合测评");
				
		classmanager.add(parameter_config);
		classmanager.add(add_delete);
		classmanager.add(course_manager);
		classmanager.add(colligate_info);
		
		//菜单项-信息查询
		JMenu info_lookup=new JMenu("信息查询");
		
		JMenuItem individual_info=new JMenuItem("各科成绩");
		JMenuItem colligate_query=new JMenuItem("综合测评");
		JMenuItem scholarship_query=new JMenuItem("奖学金");
				
		info_lookup.add(individual_info);
		info_lookup.add(colligate_query);
		info_lookup.add(scholarship_query);
		
		//菜单项-综测管理
		JMenu colligate_manager=new JMenu("综测管理");
		
		JMenuItem basic_diath=new JMenuItem("基本素质测评");
		JMenuItem study_grade=new JMenuItem("学习成绩测评");
		JMenuItem colligate_diath=new JMenuItem("综合能力测评");
		
		colligate_manager.add(basic_diath);
		colligate_manager.add(study_grade);
		colligate_manager.add(colligate_diath);
		
		//菜单项-帮助
		JMenu help_menu=new JMenu("帮助");
		
		JMenuItem about_menuitem=new JMenuItem("关于");
		
		help_menu.add(about_menuitem);
				
		menu_bar.add(sysconfig);
		menu_bar.add(classmanager);
		menu_bar.add(info_lookup);
		menu_bar.add(colligate_manager);
		menu_bar.add(help_menu);
		mainframe.setJMenuBar(menu_bar);
		
		//菜单项单击事件的响应
		password_modify.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//修改密码
				new PasswordModify(current_username);
			}
		});
		
		user_manager.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//用户管理
				new UserManager();
			}
		});
				
		login_off.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//注销登录
				mainframe.dispose();
				new Login();
			}
		});
		
		system_exit.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//退出
				System.exit(1);
			}
		});
		
		parameter_config.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//参数设置
				new ParameterSet();
			}
		});
		
		add_delete.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//学生管理
				new StudentManager();
			}
		});
		
		colligate_info.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//综合测评
				new ColligateInfo();
			}
		});
		
		course_manager.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//课程管理
				new CourseManager();
			}
		});
		
		individual_info.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//学生信息
				new StudentQuery();
			}
		});
		
		colligate_query.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//综合测评
				new ColligateQuery();
			}
		});
		
		scholarship_query.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//综合测评
				new ScholarshipQuery();
			}
		});
		
		basic_diath.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//基本素质测评
				new BasicDiath();
			}
		});
		
		study_grade.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//学习成绩测评
				new CourseGrade();
			}
		});
		
		colligate_diath.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//综合能力测评
				new ColligateDiath();
			}
		});
		
		about_menuitem.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				//关于
				JOptionPane.showMessageDialog(mainframe,"版权所有——王成茁、丁磊、徐英英、钟英旭、金峰、朱盛灿","关于",JOptionPane.WARNING_MESSAGE);
			}
		});
		
		mainframe.pack();
		mainframe.setVisible(true);
		mainframe.addWindowListener(new WindowAdapter(){
			public void windowClosing(WindowEvent e){
				System.exit(0);
			}
		});
		
		//添加背景图片
		JLabel welcome_label=new JLabel("网络工程061班——综合测评管理系统");
		welcome_label.setFont(new java.awt.Font("宋体",1,24));
		JPanel image_panel=new JPanel();
		ImageIcon image=new ImageIcon("test.jpg");
    JLabel image_label=new JLabel();
    image_label.setIcon(image);
    image_label.setBounds(new Rectangle(0,0,200,200));
    image_panel.add(image_label);
    mainframe.add("Center",image_panel);
    mainframe.add("North",welcome_label);
    Toolkit kit=Toolkit.getDefaultToolkit();
	  Dimension screenSize=kit.getScreenSize();
	  int width=screenSize.width;
	  int height=screenSize.height;
    mainframe.setLocation((width-600)/2,(height-400)/2);
    mainframe.setSize(600,400);
    mainframe.setResizable(false);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -