綜合測評系統(tǒng)_第1頁
綜合測評系統(tǒng)_第2頁
綜合測評系統(tǒng)_第3頁
綜合測評系統(tǒng)_第4頁
綜合測評系統(tǒng)_第5頁
已閱讀5頁,還剩132頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、綜合測評管理系統(tǒng)本系統(tǒng)主要有添加、查詢、統(tǒng)計(jì)三個功能界面,以及賬號、幫助兩個菜單選項(xiàng)。進(jìn)入系統(tǒng)時,需要以管理員賬號登錄后才能使用,并支持對管理員賬號的注冊、刪除及密碼修改。同時本系統(tǒng)提供了右鍵菜單功能,可以對數(shù)據(jù)進(jìn)行全選、復(fù)制、粘貼。 其中添加界面能夠?qū)?shù)據(jù)保存在數(shù)據(jù)庫中,并能夠動態(tài)識別數(shù)據(jù)庫中保存的年級、班級信息,按年級-班級的樹狀結(jié)構(gòu)選中所需添加的班級,以文本粘貼或直接導(dǎo)入Excel的形式添加學(xué)生信息。 查詢界面提供了按學(xué)號和按姓名兩種查詢方式,查詢到的學(xué)生信息按照年級、班級、學(xué)年的優(yōu)先順序排序顯示,并能夠?qū)Σ樵兊降膶W(xué)生信息進(jìn)行修改、刪除操作。統(tǒng)計(jì)界面可以統(tǒng)計(jì)所選班級的排名信息,包括全班排

2、名、前20%排名、前50%排名,方便老師評選該班級的三好學(xué)生,并能夠生成完整的Excel綜合測評成績表。系統(tǒng)默認(rèn)的賬號為EcjtuSoftware,密碼為wearebest 歡迎使用本綜合測評系統(tǒng)!src文件下htbh文件下CESystem.java/name:CESystem.javaimport javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.*;import java.text.*;import java.io.*;import java.io.File.*;import java.util.

3、*;import java.util.Date;import jxl.*;import jxl.write.*;import static htbh.SwingConsole.*;import static htbh.Print.*;enum StatusUSER_PASS_TRUE, USER_WRONG, PASS_WRONGclass CELand extends JFrameprivate JLabel TitleLabel = new JLabel(歡迎使用綜合測評系統(tǒng)!), UserLabel = new JLabel(賬號:), PasswordLabel = new JLabe

4、l(密碼:);private JTextField UserNameTf = new JTextField(20);private JPasswordField PasswordTf = new JPasswordField(20);private JButton LoginBtn = new JButton(登錄);private JPanel TitleJp = new JPanel(), UserJp = new JPanel(), PasswordJp = new JPanel(), LoginJp = new JPanel();private ActionListener Al =

5、new ActionListener()public void actionPerformed(ActionEvent e)String UserName = UserNameTf.getText();String Password = String.valueOf(PasswordTf.getPassword();Status Result = CESystemFrame.AccountListSearch(UserName, Password);if (Result = Status.USER_PASS_TRUE)setVisible(false);System.gc();run(new

6、CESystemFrame(), XX大學(xué)軟件學(xué)院綜合測評系統(tǒng), 590, 388);else if (Result = Status.PASS_WRONG)JOptionPane.showMessageDialog(null, 密碼錯誤!,登錄狀態(tài),JOptionPane.ERROR_MESSAGE);PasswordTf.setText();else if (Result = Status.USER_WRONG)JOptionPane.showMessageDialog(null, 該賬號不存在!,登錄狀態(tài),JOptionPane.ERROR_MESSAGE);UserNameTf.set

7、Text();PasswordTf.setText();private void setBack()JPanel BackJp = new JPanel();BackJp = (JPanel)this.getContentPane();BackJp.setOpaque(false);ImageIcon Img = new ImageIcon(image/Login.jpg);JLabel BackGround = new JLabel(Img);this.getLayeredPane().add(BackGround, new Integer(Integer.MIN_VALUE);BackGr

8、ound.setBounds(0, 0, Img.getIconWidth(), Img.getIconHeight();public CELand()CESystemFrame.AccountListCreate();setBack();TitleJp.setOpaque(false);UserJp.setOpaque(false);PasswordJp.setOpaque(false);LoginJp.setOpaque(false);setLayout(new GridLayout(4,1);TitleJp.add(TitleLabel);add(TitleJp);UserJp.add(

9、UserLabel);UserNameTf.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e)PasswordTf.requestFocus(););UserJp.add(UserNameTf);add(UserJp);PasswordJp.add(PasswordLabel);PasswordTf.addActionListener(Al);PasswordJp.add(PasswordTf);add(PasswordJp);LoginBtn.addActionListener(A

10、l);LoginJp.add(LoginBtn);add(LoginJp);class CESystemFrame extends JFrameprivate JMenu AccountMenu = new JMenu(賬戶), HelpMenu = new JMenu(幫助);private JMenuItem AccountItem = new JMenuItem(注冊賬戶), PasswordItem = new JMenuItem(修改密碼), DeleteItem = new JMenuItem(刪除賬號), ExitItem = new JMenuItem(退出), Instruc

11、tionItem = new JMenuItem(功能介紹), IntroductionItem = new JMenuItem(關(guān)于本系統(tǒng));private JMenuBar Mb = new JMenuBar();private JTabbedPane Tabs = new JTabbedPane();private JPanel CalculateJp = new JPanel(), AddJp = new JPanel(), InquireJp = new JPanel(), StatisticsJp = new JPanel();private JPopupMenu popup =

12、new JPopupMenu();private JTextArea MenuItemTa;private int GradeNum = 0, GradeCount = 0, ClassCount = 0;private int ScoreNumCount = 0, StatisticsChoose = 0, InquireNumCount = 0;private int GradeNums = new int100;private long InquireStuNum = 0;private String ClassName = null, YearNumber = null, Inquir

13、eStuName = null;private static String ClassNames = new String100, YearNumbers = new String100, StudentNumbers = new String100, StudentNames = new String100, CEScoreStrs = new String100;private String Grades = new String100, Classes = new String100, Years = 第一學(xué)年, 第二學(xué)年, 第三學(xué)年, 第四學(xué)年 ;private static fina

14、l double F12 = new double100, F12Cal = new double100, F13 = new double100, F13Cal = new double100, F1Total = new double100, F21 = new double100, F22 = new double100, F23 = new double100, F2Total = new double100, F1AddF2 = new double100, F1AddF2Cal = new double100, F3 = new double100, F3Cal = new dou

15、ble100, FCal = new double100, F4 = new double100, F4Cal = new double100, CEScores = new double100;public CESystemFrame()Grades0 = 2010;Classes0 = Choose Class;CalculateJp = new JPanel()protected void paintComponent(Graphics g) super.paintComponent(g); ImageIcon img = new ImageIcon(image/BackGround.j

16、pg); img.paintIcon(this, g, 0, 0);CalculateJp.setOpaque(false);AddJp = new JPanel()protected void paintComponent(Graphics g) super.paintComponent(g); ImageIcon img = new ImageIcon(image/BackGround.jpg); img.paintIcon(this, g, 0, 0);AddJp.setOpaque(false);InquireJp = new JPanel()protected void paintC

17、omponent(Graphics g) super.paintComponent(g); ImageIcon img = new ImageIcon(image/BackGround.jpg); img.paintIcon(this, g, 0, 0);InquireJp.setOpaque(false);StatisticsJp = new JPanel()protected void paintComponent(Graphics g) super.paintComponent(g); ImageIcon img = new ImageIcon(image/BackGround.jpg)

18、; img.paintIcon(this, g, 0, 0);StatisticsJp.setOpaque(false);JMenuItem SelectAllMi = new JMenuItem(全選), CopyMi = new JMenuItem(復(fù)制), PasteMi = new JMenuItem(粘貼);SelectAllMi.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e)tryMenuItemTa.selectAll();catch (NullPointerExc

19、eption ex) MenuItemTa.requestFocus(););popup.add(SelectAllMi);popup.addSeparator();CopyMi.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e)tryMenuItemTa.copy();catch (NullPointerException ex) MenuItemTa.requestFocus(););popup.add(CopyMi);popup.addSeparator();PasteMi.a

20、ddActionListener(new ActionListener() public void actionPerformed(ActionEvent e)tryMenuItemTa.paste();catch (NullPointerException ex) MenuItemTa.requestFocus(););popup.add(PasteMi);popup.addSeparator();/菜單選項(xiàng)AccountItem.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e)

21、run(new AccountRegisterFrame(), 注冊管理員賬號, 250, 277););AccountMenu.add(AccountItem);PasswordItem.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e)run(new PasswordAlterFrame(), 修改賬號密碼, 250, 327););AccountMenu.add(PasswordItem);DeleteItem.addActionListener(new ActionListe

22、ner() public void actionPerformed(ActionEvent e)run(new AccountDeleteFrame(), 刪除管理員賬號, 250, 227););AccountMenu.add(DeleteItem);ExitItem.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e)setVisible(false);System.gc(););AccountMenu.add(ExitItem);InstructionItem.addAction

23、Listener(new ActionListener() public void actionPerformed(ActionEvent e)run(new InstructionFrame(), 功能介紹, 420, 350););HelpMenu.add(InstructionItem);IntroductionItem.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e)run(new IntroductionFrame(), 關(guān)于本系統(tǒng), 420, 160););HelpMe

24、nu.add(IntroductionItem);Mb.add(AccountMenu);Mb.add(HelpMenu);setJMenuBar(Mb);/添加界面final JComboBox AddGradeCb = new JComboBox(), AddClassCb = new JComboBox(), AddYearCb = new JComboBox();final JComboBox StatisticsGradeCb = new JComboBox(), StatisticsClassCb = new JComboBox(), StatisticsYearCb = new

25、JComboBox();final JTextField AddGradeTf = new JTextField(7), AddClassTf = new JTextField(25);JButton AddCEScoreBtn = new JButton(添加綜合測評成績), AddClassListBtn = new JButton(添加班級名單);JLabel AddGradeLabel1 = new JLabel(年級), AddClassLabel1 = new JLabel(班級), AddYearLabel = new JLabel(學(xué)年), AddGradeLabel2 = n

26、ew JLabel(年級), AddClassLabel2 = new JLabel(班級), AddInforLabel1 = new JLabel( 請選擇需添加綜合測評成績的班級:, JLabel.CENTER), AddInforLabel2 = new JLabel( 如需添加班級名單,請輸入該班級的年級與班級名:, JLabel.CENTER);JPanel AddPartJp1 = new JPanel(), AddPartJp2 = new JPanel(), AddPartJp3 = new JPanel(), AddPartJp4 = new JPanel();AddPar

27、tJp1.setOpaque(false);AddPartJp2.setOpaque(false);AddPartJp3.setOpaque(false);AddPartJp4.setOpaque(false);AddJp.setLayout(new GridLayout(4,1);AddPartJp3.setLayout(new BorderLayout();AddPartJp3.add(AddInforLabel1, BorderLayout.CENTER);AddJp.add(AddPartJp3);AddPartJp1.add(AddGradeLabel1);ClassListCrea

28、te();ClassListSearch(0, null);for (int i = 0; i GradeCount; i+) AddGradeCb.addItem(Gradesi);AddGradeCb.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e)try GradeNum = Integer.parseInt(String)(AddGradeCb.getSelectedItem();catch (NumberFormatException ex) try AddClassCb

29、.removeAllItems();catch (NullPointerException ex) ClassListSearch(GradeNum, null);for (int i = 0; i ClassCount; i+) AddClassCb.addItem(Classesi););AddPartJp1.add(AddGradeCb);AddPartJp1.add(AddClassLabel1); ClassListSearch(Integer.parseInt(Grades0), null); for (int i = 0; i ClassCount; i+) AddClassCb

30、.addItem(Classesi);AddPartJp1.add(AddClassCb);AddPartJp1.add(AddYearLabel);for (int i = 0; i Years.length; i+)AddYearCb.addItem(Yearsi);AddPartJp1.add(AddYearCb);AddCEScoreBtn.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e)try GradeNum = Integer.parseInt(String)(Add

31、GradeCb.getSelectedItem();catch (NumberFormatException ex) ClassName = (String)(AddClassCb.getSelectedItem();YearNumber = (String)(AddYearCb.getSelectedItem();if (ClassName.equals(Choose Class) JOptionPane.showMessageDialog(null, 班級不能為空,請先添加一個班級!, 錯誤提示, JOptionPane.ERROR_MESSAGE); ClassName = Choose

32、 Class; else run(new AddCEScoreFrame(), 添加綜合測評成績, 1027, 520););AddPartJp1.add(AddCEScoreBtn);AddJp.add(AddPartJp1);AddPartJp4.setLayout(new BorderLayout();AddPartJp4.add(AddInforLabel2, BorderLayout.CENTER);AddJp.add(AddPartJp4);AddPartJp2.add(AddGradeLabel2);AddGradeTf.addActionListener(new ActionL

33、istener() public void actionPerformed(ActionEvent e)AddClassTf.requestFocus(););AddPartJp2.add(AddGradeTf);AddPartJp2.add(AddClassLabel2);ActionListener AddTfAl = new ActionListener() public void actionPerformed(ActionEvent e)tryGradeNum = Integer.parseInt(AddGradeTf.getText();ClassName = AddClassTf

34、.getText();String Url = jdbc:odbc:ClassList;tryClass.forName(sun.jdbc.odbc.JdbcOdbcDriver);Connection Con = DriverManager.getConnection(Url,null);if (ClassListSearch(GradeNum, ClassName) = false)String Sql = insert into ClassList values(?, ?);PreparedStatement Ps = Con.prepareStatement(Sql);Ps.setIn

35、t(1, GradeNum);Ps.setString(2, ClassName);Ps.executeUpdate(); Ps.close(); JOptionPane.showMessageDialog(null, 添加班級名單成功!, 添加班級名單, JOptionPane.PLAIN_MESSAGE); AddGradeTf.setText(); AddClassTf.setText(); try AddGradeCb.removeAllItems(); catch (NullPointerException ex) ClassListSearch(0, null); for (int

36、 i = 0; i GradeCount; i+) AddGradeCb.addItem(Gradesi); try StatisticsGradeCb.removeAllItems(); catch (NullPointerException ex) ClassListSearch(0, null); for (int i = 0; i GradeCount; i+) StatisticsGradeCb.addItem(Gradesi);elseJOptionPane.showMessageDialog(null, 該班級信息已存在,請重新添加!, 添加班級名單, JOptionPane.W

37、ARNING_MESSAGE);AddGradeTf.setText();AddClassTf.setText();AddGradeTf.requestFocus();Con.close();catch(java.lang.ClassNotFoundException ex)catch(SQLException ex)println(ex.getMessage();catch (NumberFormatException ex)JOptionPane.showMessageDialog(null, 年級信息輸入錯誤,請輸入數(shù)字!, 錯誤提示, JOptionPane.ERROR_MESSAGE

38、);AddClassTf.addActionListener(AddTfAl);AddPartJp2.add(AddClassTf);AddClassListBtn.addActionListener(AddTfAl);AddPartJp2.add(AddClassListBtn);AddJp.add(AddPartJp2);Tabs.addTab(添加, AddJp);add(Tabs);/查詢界面final JTextField StuNumTf = new JTextField(20), StuNameTf = new JTextField(10);JButton StuNumBtn =

39、 new JButton(按學(xué)號查找), StuNameBtn = new JButton(按姓名查找);JLabel StuNumLabel = new JLabel(學(xué)號), StuNameLabel = new JLabel(姓名), InquireInforLabel1 = new JLabel(請輸入需要查找的學(xué)號:, JLabel.CENTER), InquireInforLabel2 = new JLabel(請輸入需要查找的姓名:, JLabel.CENTER);JPanel InquirePartJp1 = new JPanel(), InquirePartJp2 = new

40、 JPanel(), InquirePartJp3 = new JPanel(), InquirePartJp4 = new JPanel();InquirePartJp1.setOpaque(false);InquirePartJp2.setOpaque(false);InquirePartJp3.setOpaque(false);InquirePartJp4.setOpaque(false);InquireJp.setLayout(new GridLayout(4,1);InquirePartJp3.setLayout(new BorderLayout();InquirePartJp3.a

41、dd(InquireInforLabel1, BorderLayout.CENTER);InquireJp.add(InquirePartJp3);InquirePartJp1.add(StuNumLabel);ActionListener InquireNumAl = new ActionListener()public void actionPerformed(ActionEvent e)boolean Result = false;try InquireStuNum = Long.parseLong(StuNumTf.getText();tryResult = CESystemSearc

42、h(0, null, null, String.valueOf(InquireStuNum), null);catch (NullPointerException ex) if (Result)run(new InquireInforFrame(), 查詢學(xué)生信息, 1000, 130 + (InquireNumCount - 1) * 25);StuNumTf.setText();elseJOptionPane.showMessageDialog(null, 對不起,沒有查找到該學(xué)生信息!, 查詢綜合測評成績, JOptionPane.ERROR_MESSAGE);catch (Number

43、FormatException ex)JOptionPane.showMessageDialog(null, 學(xué)號輸入有誤,請重新輸入!, 查詢綜合測評成績, JOptionPane.ERROR_MESSAGE);StuNumTf.setText();StuNumTf.addActionListener(InquireNumAl);InquirePartJp1.add(StuNumTf);StuNumBtn.addActionListener(InquireNumAl);InquirePartJp1.add(StuNumBtn);InquireJp.add(InquirePartJp1);In

44、quirePartJp4.setLayout(new BorderLayout();InquirePartJp4.add(InquireInforLabel2, BorderLayout.CENTER);InquireJp.add(InquirePartJp4);InquirePartJp2.add(StuNameLabel);ActionListener InquireNameAl = new ActionListener()public void actionPerformed(ActionEvent e)boolean Result = false;tryInquireStuName =

45、 StuNameTf.getText();tryResult = CESystemSearch(0, null, null, null, InquireStuName);catch (NullPointerException ex) if (Result)run(new InquireInforFrame(), 查詢學(xué)生信息, 1000, 130 + (InquireNumCount - 1) * 25);StuNameTf.setText();elseJOptionPane.showMessageDialog(null, 對不起,沒有查找到該學(xué)生信息!, 查詢綜合測評成績, JOptionPane.ERROR_MESSAGE);catch (NumberFormatException ex)JOptionPane.showMessageDialog(null, 姓名輸入有誤,請重新輸入!, 查詢綜合測評成績, JOptionPane.ERROR_MESSAGE);StuNameTf.setText();StuNameTf.addActionListener(InquireNameAl);InquirePartJp2.add(StuNameTf);StuNameB

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論