package studentms;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import java.sql.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class menuClass extends JFrame {
JPanel contentPane;
JMenuBar mainMenu = new JMenuBar();
JMenu menuSystem=new JMenu();
JMenuItem itemExit=new JMenuItem();
JMenu menuInfo=new JMenu();
JMenuItem itemShow=new JMenuItem();
JMenuItem itemAdd=new JMenuItem();
JMenuItem itemEdit=new JMenuItem();
JMenuItem itemDelete=new JMenuItem();
JMenu menuGrade=new JMenu();
JMenuItem itemShowG=new JMenuItem();
JMenuItem itemAddG=new JMenuItem();
JMenu menuOrder=new JMenu();
JMenuItem itemByTotal=new JMenuItem();
JMenuItem itemByChinese=new JMenuItem();
JMenuItem itemByMath=new JMenuItem();
JMenuItem itemByEnglish=new JMenuItem();
JMenuItem itemByComposite=new JMenuItem();
JMenuItem itemEditG=new JMenuItem();
JMenuItem itemDeleteG=new JMenuItem();
JMenu menuSearchAll=new JMenu();
JMenu menuSearch=new JMenu();
JMenuItem itemSearchByName=new JMenuItem();
JMenuItem itemSearchByNum=new JMenuItem();
JMenuItem itemSearchByClass=new JMenuItem();
JMenuItem itemSearchGrade=new JMenuItem();
JMenu menuSum=new JMenu();
JMenuItem itemSumPeople=new JMenuItem();
JMenuItem itemSumGrade=new JMenuItem();
JMenu menuHelp=new JMenu();
JMenuItem itemAbout=new JMenuItem();
XYLayout xYLayout1 = new XYLayout();
//成绩排序时使用的数据库操作
ResultSet rs ;
String sql =new String();
Database DB=new Database();
//设置不同的人员信息显示窗体,供不同窗体的查询返回结果用
public static stuInfo SIFall = new stuInfo();
public static editStuInfo editInfo=new editStuInfo();
public static delStuInfo delInfo=new delStuInfo();
public static gradeInfo graInfo=new gradeInfo();
//Construct the frame
public menuClass() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(xYLayout1);
this.setSize(new Dimension(400, 300));
this.setTitle("学生管理系统");
menuSystem.setText("系统管理");
menuSystem.setFont(new java.awt.Font("Dialog", 0, 12));
menuInfo.setText("信息管理");
menuInfo.setFont(new java.awt.Font("Dialog", 0, 12));
menuGrade.setText("成绩管理") ;
menuGrade.setFont(new java.awt.Font("Dialog", 0, 12));
menuSearchAll.setText("查询");
menuSearchAll.setFont(new java.awt.Font("Dialog", 0, 12));
menuSearch.setText("查询人员");
menuSearch.setFont(new java.awt.Font("Dialog", 0, 12));
menuSum.setText("统计");
menuSum.setFont(new java.awt.Font("Dialog", 0, 12));
menuHelp.setText("帮助");
menuHelp.setFont(new java.awt.Font("Dialog", 0, 12));
itemShow.setText("信息综合管理");
itemShow.setFont(new java.awt.Font("Dialog", 0, 12));
itemShow.addActionListener(new menuClass_itemShow_ActionAdapter(this));
itemAdd.setText("添加信息");
itemAdd.setFont(new java.awt.Font("Dialog", 0, 12));
itemAdd.addActionListener(new menuClass_itemAdd_ActionAdapter(this));
itemEdit.setText("修改信息");
itemEdit.addActionListener(new menuClass_itemEdit_actionAdapter(this));
itemEdit.setFont(new java.awt.Font("Dialog", 0, 12));
itemDelete.setText("删除信息");
itemDelete.addActionListener(new menuClass_itemDelete_actionAdapter(this));
itemDelete.setFont(new java.awt.Font("Dialog", 0, 12));
itemExit.setText("退出");
itemExit.addActionListener(new menuClass_itemExit_ActionAdapter(this));
itemExit.setFont(new java.awt.Font("Dialog", 0, 12));
itemShowG.setText("成绩综合管理");
itemShowG.setFont(new java.awt.Font("Dialog", 0, 12));
itemShowG.addActionListener(new menuClass_itemShowG_ActionAdapter(this));
itemAddG.setText("添加成绩");
itemAddG.addActionListener(new menuClass_itemAddG_actionAdapter(this));
itemAddG.setFont(new java.awt.Font("Dialog", 0, 12));
itemEditG.setText("修改成绩");
itemEditG.addActionListener(new menuClass_itemEditG_actionAdapter(this));
itemEditG.setFont(new java.awt.Font("Dialog", 0, 12));
itemDeleteG.setText("删除成绩");
itemDeleteG.addActionListener(new menuClass_itemDeleteG_actionAdapter(this));
itemDeleteG.setFont(new java.awt.Font("Dialog", 0, 12));
menuOrder.setText("排序");
menuOrder.setFont(new java.awt.Font("Dialog", 0, 12));
itemByTotal.setText("按总成绩");
itemByTotal.addActionListener(new menuClass_itemByTotal_actionAdapter(this));
itemByTotal.setFont(new java.awt.Font("Dialog", 0, 12));
itemByChinese.setText("按语文成绩");
itemByChinese.setFont(new java.awt.Font("Dialog", 0, 12));
itemByChinese.addActionListener(new menuClass_itemByChinese_actionAdapter(this));
itemByMath.setText("按数学成绩");
itemByMath.addActionListener(new menuClass_itemByMath_actionAdapter(this));
itemByMath.setFont(new java.awt.Font("Dialog", 0, 12));
itemByEnglish.setText("按英语成绩");
itemByEnglish.addActionListener(new menuClass_itemByEnglish_actionAdapter(this));
itemByEnglish.setFont(new java.awt.Font("Dialog", 0, 12));
itemByComposite.setText("按综合成绩");
itemByComposite.addActionListener(new menuClass_itemByComposite_actionAdapter(this));
itemByComposite.setFont(new java.awt.Font("Dialog", 0, 12));
itemSearchByName.setText("按姓名");
itemSearchByName.setFont(new java.awt.Font("Dialog", 0, 12));
itemSearchByName.addActionListener(new menuClass_itemSearchByName_ActionAdapter(this));
itemSearchByNum.setText("按学号");
itemSearchByNum.setFont(new java.awt.Font("Dialog", 0, 12));
itemSearchByNum.addActionListener(new menuClass_itemSearchByNum_ActionAdapter(this));
itemSearchByClass.setText("按班级");
itemSearchByClass.setFont(new java.awt.Font("Dialog", 0, 12));
itemSearchByClass.addActionListener(new menuClass_itemSearchByClass_ActionAdapter(this));
itemSearchGrade.setText("查询成绩");
itemSearchGrade.setFont(new java.awt.Font("Dialog", 0, 12));
itemSearchGrade.addActionListener(new menuClass_itemSearchGrade_ActionAdapter(this));
itemSumPeople.setText("人员统计");
itemSumPeople.addActionListener(new menuClass_itemSumPeople_actionAdapter(this));
itemSumPeople.setFont(new java.awt.Font("Dialog", 0, 12));
itemSumGrade.setText("成绩统计");
itemSumGrade.addActionListener(new menuClass_itemSumGrade_actionAdapter(this));
itemSumGrade.setFont(new java.awt.Font("Dialog", 0, 12));
itemAbout.setText("关于");
itemAbout.setFont(new java.awt.Font("Dialog", 0, 12));
contentPane.setFont(new java.awt.Font("Dialog", 0, 12));
// menuUser.addSeparator() ;
menuSystem.add(itemExit);
menuInfo.add(itemShow);
menuInfo.addSeparator();
menuInfo.add(itemAdd);
menuInfo.add(itemEdit);
menuInfo.add(itemDelete);
menuGrade.add(itemShowG);
menuGrade.add(itemAddG);
menuGrade.addSeparator() ;
menuGrade.add(menuOrder);
menuOrder.add(itemByTotal);
menuOrder.add(itemByChinese);
menuOrder.add(itemByMath);
menuOrder.add(itemByEnglish);
menuOrder.add(itemByComposite);
menuSearchAll.add(menuSearch);
menuSearchAll.add(itemSearchGrade);
menuSearch.add(itemSearchByName);
menuSearch.add(itemSearchByNum);
menuSearch.add(itemSearchByClass);
menuSum.add(itemSumPeople);
menuSum.add(itemSumGrade);
menuHelp.add(itemAbout);
mainMenu.add(menuSystem);
mainMenu.add(menuInfo);
mainMenu.add(menuGrade);
mainMenu.add(menuSearchAll);
mainMenu.add(menuSum);
mainMenu.add(menuHelp);
this.setJMenuBar(mainMenu);
}
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CL