JAV課程設(shè)計(jì)人事管理系統(tǒng)_第1頁(yè)
JAV課程設(shè)計(jì)人事管理系統(tǒng)_第2頁(yè)
JAV課程設(shè)計(jì)人事管理系統(tǒng)_第3頁(yè)
JAV課程設(shè)計(jì)人事管理系統(tǒng)_第4頁(yè)
JAV課程設(shè)計(jì)人事管理系統(tǒng)_第5頁(yè)
已閱讀5頁(yè),還剩9頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、目 錄設(shè)計(jì)目的-1功能介紹-1程序流程-1設(shè)計(jì)步驟-2設(shè)計(jì)總結(jié)-6程序清單-8參考文獻(xiàn)-14一、 設(shè)計(jì)目的通過(guò)課程設(shè)計(jì),使學(xué)生提高理論聯(lián)系實(shí)際解決實(shí)際問(wèn)題的能力;也使學(xué)生對(duì)基于面向?qū)ο蟮睦碚撨M(jìn)行系統(tǒng)設(shè)計(jì)過(guò)程中的諸多具體問(wèn)題有感性的認(rèn)識(shí)和深入的理解;進(jìn)而提高學(xué)生的學(xué)習(xí)興趣為其將來(lái)順利進(jìn)入畢業(yè)環(huán)節(jié)作必要的準(zhǔn)備。由教師布置課程設(shè)計(jì)的題目與思路,學(xué)生每56人一個(gè)題目,按照教師給出的思路和計(jì)劃進(jìn)度安排獨(dú)立完成課程設(shè)計(jì),最后每人提交一份課程設(shè)計(jì)報(bào)告。二、 功能介紹該系統(tǒng)設(shè)計(jì)的五大功能:(1)具有新用戶(hù)注冊(cè)功能。(2)具有注冊(cè)用戶(hù)登錄功能。(3)具有數(shù)據(jù)的錄入功能。(4)具有數(shù)據(jù)查詢(xún)功能,可以實(shí)現(xiàn)查詢(xún)?nèi)啃?/p>

2、息和按條件執(zhí)行查詢(xún)。(5)具有按條件刪除數(shù)據(jù)功能。(6)具有統(tǒng)計(jì)功能三、 程序流程四、 設(shè)計(jì)步驟 Person類(lèi)在Person類(lèi)中,除了構(gòu)造方法外,還重載了toString()方法。public String toString()String s=ID+ +name+ +sex+ +position+ +wage;return s;Personnel類(lèi)在Personnel類(lèi)中,有三個(gè)成員方法:添加:public void addPerson(String id,String name,String sex,String position,String wage)pList.add(new Pe

3、rson(id,name,sex,position,wage);刪除:public void deletePerson(String id)it=pList.listIterator();while(it.hasNext()p=(Person)it.next();if(p.ID.equals(id)it.remove();break; 查詢(xún):public Person seekPerson(String id)p=null;it=pList.listIterator();while(it.hasNext()p=(Person)it.next();if(p.ID.equals(id)break;

4、elsep=null;return p;PersonJFrame類(lèi)在PersonJFrame類(lèi)中,構(gòu)造方法設(shè)置整個(gè)界面的布局及界面上的標(biāo)簽、按鈕、文本框,為按鈕注冊(cè)單擊事件監(jiān)聽(tīng)器,為列表框注冊(cè)鼠標(biāo)事件監(jiān)聽(tīng)器。單擊事件的事件處理程序由ActionListener接口中的actionPerformed()方法實(shí)現(xiàn),在該方法中進(jìn)行按鈕類(lèi)的處理。當(dāng)單擊一個(gè)按鈕時(shí),Java創(chuàng)建一個(gè)ActionEvent事件類(lèi)對(duì)象e,并且自動(dòng)執(zhí)行actionPerformed()方法,在actionPerformed()方法體中,調(diào)用e.getSource()方法獲得產(chǎn)生單擊事件的事件源,即用戶(hù)單擊的是哪一個(gè)按鈕,識(shí)別出

5、按鈕后,則分別執(zhí)行需要的操作。text.setText()方法設(shè)置文本行內(nèi)容,combobox.setSelectedItem()方法返回選中數(shù)據(jù)項(xiàng)對(duì)象,combobox.getSelectedIndex()方法返回選中數(shù)據(jù)項(xiàng)索引。鼠標(biāo)事件的事件處理程序由mouseClicked()方法實(shí)現(xiàn),單擊列表框里面的內(nèi)容即可在輸入信息處顯示信息。public void actionPerformed(ActionEvent e) if(e.getSource()=add) if(!text_ID.getText().equals() String s=(String) combobox_sex.get

6、SelectedItem(); String p=(String) combobox_position.getSelectedItem(); personnel.addPerson(text_ID.getText(),text_name.getText(),s,p,text_wage.getText(); list.setListData(personnel.pList.toArray(); if(e.getSource()=delete) personnel.deletePerson(text_ID.getText(); text_ID.setText(); text_name.setTex

7、t(); text_quantity.setText(); text_wage.setText(); list.setListData(personnel.pList.toArray(); if(e.getSource()=seek) String id=JOptionPane.showInputDialog(請(qǐng)輸入要查詢(xún)的員工編號(hào):); Person thePerson=personnel.seekPerson(id); if(thePerson=null) JOptionPane.showMessageDialog(this,查無(wú)此人!,查詢(xún)結(jié)果,JOptionPane.WARNING_M

8、ESSAGE); else String s=; text_ID.setText(thePerson.ID); text_name.setText(theP); combobox_sex.setSelectedItem(thePerson.sex); combobox_position.setSelectedItem(thePerson.position); text_wage.setText(thePerson.wage); s=text_ID.getText()+text_name.getText()+combobox_sex.getSelectedItem()+ +c

9、ombobox_position.getSelectedItem()+ +text_wage.getText(); JOptionPane.showMessageDialog(this,你要查詢(xún)的員工信息:n+s,查詢(xún)結(jié)果,JOptionPane.INFORMATION_MESSAGE); if(e.getSource()=wageC) if(combobox_position.getSelectedIndex()=0) N=text_quantity.getText(); i=Double.parseDouble(N); w=4000+i*0.005; text_wage.setText(¥

10、+this.w); if(combobox_position.getSelectedIndex()=1) N=text_quantity.getText(); i=Double.parseDouble(N); w=2000+i*0.05; text_wage.setText(¥+this.w); if(combobox_position.getSelectedIndex()=2) if(combobox_perform.getSelectedIndex()=0) w=3000+1000; if(combobox_perform.getSelectedIndex()=1) w=3000+500;

11、 if(combobox_perform.getSelectedIndex()=2) w=3000; text_quantity.setText(); text_wage.setText(¥+this.w); if(e.getSource()=cancel) System.exit(0); 五、 設(shè)計(jì)總結(jié)這次的課程設(shè)計(jì),是在學(xué)習(xí)了Java以后通過(guò)閱讀課本及在圖書(shū)館借閱相關(guān)書(shū)籍完成的。在開(kāi)發(fā)這個(gè)系統(tǒng)的過(guò)程中,碰到很多或大或小的問(wèn)題,我們一起思考,一起努力,最后大部分都解決了,得到了現(xiàn)在的這個(gè)簡(jiǎn)單的人事管理系統(tǒng)。 在編制過(guò)程中,我們首先考慮到了界面的友好性,并在界面設(shè)計(jì)時(shí)不采用煩瑣的細(xì)節(jié),使界面簡(jiǎn)

12、單、清晰,便于操作。一開(kāi)始我們是想做個(gè)登錄界面,實(shí)現(xiàn)用戶(hù)的登錄權(quán)限管理,但試了幾次都沒(méi)有達(dá)到預(yù)期的效果,最后不得不放棄。通過(guò)這次課程設(shè)計(jì),我知道了什么事情都不那么簡(jiǎn)單,只有努力去做了,你才會(huì)有收獲,不管收獲大小,付出的過(guò)程總是有的。有些事情只有親身感受,你才知道它的價(jià)值有多大。同時(shí)在遇到困難的時(shí)候要沉著冷靜,首先要冷靜分析問(wèn)題,對(duì)于很難解決的問(wèn)題要學(xué)會(huì)請(qǐng)教他人,還可以與別人合作。雖然這次課程設(shè)計(jì)付出了大量的時(shí)間,但是我知道我得到的收獲遠(yuǎn)遠(yuǎn)不是這些時(shí)間可以衡量的,它將給我今后的學(xué)習(xí)和工作帶來(lái)更多的收益。通過(guò)對(duì)此課題的開(kāi)發(fā),使我對(duì)用Java開(kāi)發(fā)系統(tǒng)有了一個(gè)比較清楚的認(rèn)識(shí),體會(huì)到理論和實(shí)踐的重要性。

13、由于自己的分析設(shè)計(jì)和程序經(jīng)驗(yàn)不足,該系統(tǒng)設(shè)計(jì)和實(shí)現(xiàn)過(guò)程中,還有許多沒(méi)有完善的地方,比如沒(méi)有設(shè)置登錄界面,沒(méi)有考慮到異常等多方面問(wèn)題,這些都有待進(jìn)一步完善和提高。對(duì)于文中出現(xiàn)的不足和系統(tǒng)中出現(xiàn)的問(wèn)題敬請(qǐng)老師指導(dǎo)。六、 程序清單Person類(lèi)package mypackage;import java.util.*;public class Person public String ID,name,sex,position,wage;public Person(String id,String na,String se,String po,String wa)ID=id;name=na;sex=se

14、;position=po;wage=wa;public String toString()String s=ID+ +name+ +sex+ +position+ +wage;return s; Personnel類(lèi)package mypackage;import java.util.*;public class Personnel public List pList=new ArrayList();private ListIterator it;private Person p;public void addPerson(String id,String name,String sex,St

15、ring position,String wage)pList.add(new Person(id,name,sex,position,wage);public void deletePerson(String id)it=pList.listIterator();while(it.hasNext()p=(Person)it.next();if(p.ID.equals(id)it.remove();break;public Person seekPerson(String id)p=null;it=pList.listIterator();while(it.hasNext()p=(Person

16、)it.next();if(p.ID.equals(id)break;elsep=null;return p;PersonJFrame類(lèi)package mypackage;import java.awt.*;import java.awt.event.*;import javax.swing.*;public class PersonJFrame extends JFrame implements ActionListener private JLabel lab1,lab2,lab3,lab4,lab5,lab6,lab7,lab8; private JTextField text_ID,t

17、ext_name,text_quantity,text_wage; private JButton add,delete,seek,cancel,wageC; private JComboBox combobox_sex,combobox_position,combobox_perform; private JPanel pan1,pan2; private JList list; private Personnel personnel=new Personnel(); private String N; private double i,w=0; public PersonJFrame()

18、super(簡(jiǎn)單人事管理系統(tǒng)(歡迎進(jìn)入(*_*) ); this.setSize(500,350); this.setLocation(300,240); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setVisible(true); this.setLayout(new BorderLayout(1,1); this.setResizable(false); list=new JList(); this.add(list,BorderLayout.WEST); list.setPreferredSize(new Dimension(2

19、50,350); list.setListData(personnel.pList.toArray(); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); validate(); pan1 = new JPanel(new GridLayout(8,1); lab7=new JLabel(員工基本信息); pan1.add(lab7); lab8=new JLabel(輸入基本信息); pan1.add(lab8); lab1=new JLabel(編號(hào):); pan1.add(lab1); text_ID=new JTex

20、tField(10); pan1.add(text_ID); lab2=new JLabel(姓名:); pan1.add(lab2); text_name=new JTextField(10); pan1.add(text_name); lab3=new JLabel(性別:); pan1.add(lab3); Object sex=男,女; combobox_sex= new JComboBox(sex); pan1.add(combobox_sex); lab4=new JLabel(職位:); pan1.add(lab4); Object position=經(jīng)理,銷(xiāo)售人員,倉(cāng)庫(kù)管理員;

21、 combobox_position= new JComboBox(position); pan1.add(combobox_position); lab5=new JLabel(工作表現(xiàn):); pan1.add(lab5); Object perform=Perfect,Good,So-so; combobox_perform= new JComboBox(perform); pan1.add(combobox_perform); lab6=new JLabel(銷(xiāo)售額/營(yíng)業(yè)額:); pan1.add(lab6); text_quantity=new JTextField(10); pan1

22、.add(text_quantity); wageC=new JButton(工資:); pan1.add(wageC); text_wage=new JTextField(10); pan1.add(text_wage); text_wage.setEditable(false); this.add(pan1,BorderLayout.EAST); validate(); pan2=new JPanel(); add=new JButton(添加); delete=new JButton(刪除); seek=new JButton(查詢(xún)); cancel=new JButton(退出); p

23、an2.add(add); pan2.add(delete); pan2.add(seek); pan2.add(cancel); this.add(pan2,BorderLayout.SOUTH); validate(); add.addActionListener(this); delete.addActionListener(this); seek.addActionListener(this); cancel.addActionListener(this); wageC.addActionListener(this); list.addMouseListener(new MouseAd

24、apter() public void mouseClicked(MouseEvent e) Person thePerson=(Person)(list.getSelectedValue(); text_ID.setText(thePerson.ID); text_name.setText(theP); combobox_sex.setSelectedItem(thePerson.sex); combobox_position.setSelectedItem(thePerson.position); text_wage.setText(thePerson.wage); )

25、; public void actionPerformed(ActionEvent e) if(e.getSource()=add) if(!text_ID.getText().equals() String s=(String) combobox_sex.getSelectedItem(); String p=(String) combobox_position.getSelectedItem(); personnel.addPerson(text_ID.getText(),text_name.getText(),s,p,text_wage.getText(); list.setListDa

26、ta(personnel.pList.toArray(); if(e.getSource()=delete) personnel.deletePerson(text_ID.getText(); text_ID.setText(); text_name.setText(); text_quantity.setText(); text_wage.setText(); list.setListData(personnel.pList.toArray(); if(e.getSource()=seek) String id=JOptionPane.showInputDialog(請(qǐng)輸入要查詢(xún)的員工編號(hào):

27、); Person thePerson=personnel.seekPerson(id); if(thePerson=null) JOptionPane.showMessageDialog(this,查無(wú)此人!,查詢(xún)結(jié)果,JOptionPane.WARNING_MESSAGE); else String s=; text_ID.setText(thePerson.ID); text_name.setText(theP); combobox_sex.setSelectedItem(thePerson.sex); combobox_position.setSelectedIte

28、m(thePerson.position); text_wage.setText(thePerson.wage); s=text_ID.getText()+text_name.getText()+combobox_sex.getSelectedItem()+ +combobox_position.getSelectedItem()+ +text_wage.getText(); JOptionPane.showMessageDialog(this,你要查詢(xún)的員工信息:n+s,查詢(xún)結(jié)果,JOptionPane.INFORMATION_MESSAGE); if(e.getSource()=wageC

29、) if(combobox_position.getSelectedIndex()=0) N=text_quantity.getText(); i=Double.parseDouble(N); w=4000+i*0.005; text_wage.setText(¥+this.w); if(combobox_position.getSelectedIndex()=1) N=text_quantity.getText(); i=Double.parseDouble(N); w=2000+i*0.05; text_wage.setText(¥+this.w); if(combobox_positio

30、n.getSelectedIndex()=2) if(combobox_perform.getSelectedIndex()=0) w=3000+1000; if(combobox_perform.getSelectedIndex()=1) w=3000+500; if(combobox_perform.getSelectedIndex()=2) w=3000; text_quantity.setText(); text_wage.setText(¥+this.w); if(e.getSource()=cancel) System.exit(0); public static void mai

31、n(String args) new PersonJFrame(); 七、 參考文獻(xiàn)1.張海藩.軟件工程導(dǎo)論.北京:清華大學(xué)出版社,2003。2.王要武.管理系統(tǒng).北京:電子工業(yè)出版社,2003。3. 盧瀟.軟件工程.北京:清華大學(xué)出版社,2005。4.宋昆,李嚴(yán).SQL Server數(shù)據(jù)庫(kù)開(kāi)發(fā)實(shí)例解析.北京:機(jī)械工業(yè)出版社,2006。5. 耿詳義.JAVA2教程.北京:清華大學(xué)出版社,2004。6.張仿彥.JAVA項(xiàng)目開(kāi)發(fā)全程實(shí)錄.北京:清華大學(xué)出版社,2007。7. 楊小虎.軟件工程課程設(shè)計(jì).浙江:浙江大學(xué)出版社,2007。8. 韓萬(wàn)江.軟件工程案例教程.北京:機(jī)械工業(yè)出版社,2007。9. 劉竹林,白振林,盧潤(rùn)彩.軟件工程與項(xiàng)目管理.北京:北京師范大學(xué)出版社,2005。tgKQcWA3Pt

溫馨提示

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

最新文檔

評(píng)論

0/150

提交評(píng)論