java學籍管理系統(tǒng)源代碼_第1頁
java學籍管理系統(tǒng)源代碼_第2頁
java學籍管理系統(tǒng)源代碼_第3頁
java學籍管理系統(tǒng)源代碼_第4頁
java學籍管理系統(tǒng)源代碼_第5頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、精選優(yōu)質文檔-傾情為你奉上package zuoye;/主類import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.io.*;import java.util.Hashtable;public class ManagerWindow extends JFrame implements ActionListener InputStudent 基本信息錄入=null; ModifySituation 基本信息修改=null; Inquest 基本信息查詢=null; Delete 基本信息刪除=null;

2、 JPanel pCenter,p,p9; TextField txtName,txtPassword; Label lblTitle,lblName,lblPassword; Button btnSubmit,btnReset,guanbi; Panel p1,p11,p12,p2,p13,p14,p15; JMenuBar bar; ImageIcon icon; JMenu fileMenu; JMenuItem 錄入,修改,查詢,刪除,歡迎,退出,關于; Container con=null; Hashtable 基本信息=null; File file=null; CardLayou

3、t card=null; JLabel label=null; JLabel label2; public ManagerWindow() p=new JPanel(); lblName=new Label("管理員帳號:"); txtName=new TextField(10); lblPassword=new Label("密 碼:"); txtPassword=new TextField(10); txtPassword.setEchoChar('*'); btnSubmit = new Button("提交")

4、; btnReset = new Button("重置"); guanbi=new Button("關閉"); p11=new Panel(); p12=new Panel(); p13=new Panel(); p14=new Panel(); p15=new Panel(); p11.add(lblName); p11.add(txtName); p12.add(lblPassword); p12.add(txtPassword); txtName.addActionListener(this); txtPassword.addActionListe

5、ner(this); p13.add(btnSubmit); btnSubmit.setBackground(Color.YELLOW); p13.add(btnReset); btnReset.setBackground(Color.YELLOW); p13.add(guanbi); guanbi.setBackground(Color.YELLOW); btnSubmit.addActionListener(this); btnReset.addActionListener(this); guanbi.addActionListener(this); p.setLayout(new Gri

6、dLayout(10,1); p.add(p14); p.add(p15); p.add(p11); p.add(p12); p.add(p13); p.setBackground(Color.gray); p9=new JPanel(); icon=new ImageIcon("123.jpg"); label2=new JLabel(icon,JLabel.LEFT); label=new JLabel("歡迎使用學生基本信息管理系統(tǒng)",JLabel.CENTER); label.setFont(new Font("TimesRoman&q

7、uot;,Font.BOLD,24); label.setForeground(Color.red); p9.setOpaque(true); p9.add(label); p9.add(label2); 錄入=new JMenuItem("錄入學生基本信息"); 修改=new JMenuItem("修改學生基本信息"); 查詢=new JMenuItem("查詢學生基本信息"); 刪除=new JMenuItem("刪除學生基本信息"); 歡迎=new JMenuItem("歡迎界面"); 退

8、出=new JMenuItem("退出"); 關于=new JMenuItem("關于我們"); bar=new JMenuBar(); fileMenu=new JMenu("菜單選項"); fileMenu.add(錄入); fileMenu.add(修改); fileMenu.add(查詢); fileMenu.add(刪除); fileMenu.add(歡迎); fileMenu.add(關于); fileMenu.add(退出); fileMenu.enable(false); bar.add(fileMenu); setJ

9、MenuBar(bar); 基本信息=new Hashtable(); 錄入.addActionListener(this); 修改.addActionListener(this); 查詢.addActionListener(this); 刪除.addActionListener(this); 歡迎.addActionListener(this); 退出.addActionListener(this); 關于.addActionListener(this); card=new CardLayout(); con=getContentPane(); pCenter=new JPanel(); p

10、Center.setLayout(card); pCenter.setBackground(Color.black); file=new File("作業(yè).txt"); if(!file.exists() try FileOutputStream out=new FileOutputStream(file); ObjectOutputStream objectOut=new ObjectOutputStream(out); objectOut.writeObject(基本信息); objectOut.close(); out.close(); catch(IOExcepti

11、on e) 基本信息錄入=new InputStudent(file); 基本信息修改=new ModifySituation(file); 基本信息查詢=new Inquest(this,file); 基本信息刪除=new Delete(file); pCenter.add(p,BorderLayout.CENTER); pCenter.add("歡迎語界面",p9); pCenter.add("錄入界面",基本信息錄入); pCenter.add("修改界面",基本信息修改); pCenter.add("刪除界面&quo

12、t;,基本信息刪除); con.add(pCenter,BorderLayout.CENTER); con.validate(); addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); setVisible(true); setBounds(500,200,450,400); validate(); public void clear()txtName.setText("");txtPassword.setText("&qu

13、ot;);SuppressWarnings("deprecation")public void submit()String n=txtName.getText();String paw=txtPassword.getText();if(n.equals("admin") && paw.equals("1234")JOptionPane.showMessageDialog(this,"合法用戶,歡迎進入本系統(tǒng)");card.show(pCenter,"歡迎語界面");fileMe

14、nu.enable();elseJOptionPane.showMessageDialog(this,"非法用戶,禁止進入本系統(tǒng)");public void actionPerformed(ActionEvent e) if(e.getSource()=錄入) card.show(pCenter,"錄入界面"); else if(e.getSource()=修改) card.show(pCenter,"修改界面"); else if(e.getSource()=查詢) 基本信息查詢.setVisible(true); else if(

15、e.getSource()=刪除) card.show(pCenter,"刪除界面"); else if(e.getSource()=歡迎) card.show(pCenter,"歡迎語界面"); else if(e.getSource()=退出) System.exit(0); else if(e.getSource()=關于) JOptionPane.showMessageDialog(this,"五塊二小組:常永恒,孫東升,李強,吳春亮,涂留定"); String s=e.getActionCommand();if(s.equals("重置")clear();else if(s.equals

溫馨提示

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

評論

0/150

提交評論