




下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上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 錄入,修改,查詢,刪除,歡迎,退出,關(guān)于; 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("關(guān)閉"); 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("歡迎使用學(xué)生基本信息管理系統(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("錄入學(xué)生基本信息"); 修改=new JMenuItem("修改學(xué)生基本信息"); 查詢=new JMenuItem("查詢學(xué)生基本信息"); 刪除=new JMenuItem("刪除學(xué)生基本信息"); 歡迎=new JMenuItem("歡迎界面"); 退
8、出=new JMenuItem("退出"); 關(guān)于=new JMenuItem("關(guān)于我們"); bar=new JMenuBar(); fileMenu=new JMenu("菜單選項(xiàng)"); fileMenu.add(錄入); fileMenu.add(修改); fileMenu.add(查詢); fileMenu.add(刪除); fileMenu.add(歡迎); fileMenu.add(關(guān)于); 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); 關(guān)于.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,"合法用戶,歡迎進(jìn)入本系統(tǒng)");card.show(pCenter,"歡迎語界面");fileMe
14、nu.enable();elseJOptionPane.showMessageDialog(this,"非法用戶,禁止進(jìn)入本系統(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()=關(guān)于) JOptionPane.showMessageDialog(this,"五塊二小組:常永恒,孫東升,李強(qiáng),吳春亮,涂留定"); String s=e.getActionCommand();if(s.equals("重置")clear();else if(s.equals
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 計(jì)算機(jī)三級數(shù)據(jù)安全管理知識(shí)與試題及答案
- 安徽省計(jì)算機(jī)vb考試試題及答案
- 招警考試申論試題及答案
- 初級社會(huì)工作者考試高效復(fù)習(xí)試題及答案
- 2025年軟件評測師復(fù)習(xí)方法總結(jié)試題及答案
- 精密鑄造工廠管理制度
- 推廣部門業(yè)務(wù)管理制度
- 招生電話銷售管理制度
- 農(nóng)產(chǎn)品銷售管理制度
- 煤炭發(fā)運(yùn)站管理制度
- 財(cái)務(wù)管理企業(yè)項(xiàng)目投資
- 2024年注會(huì)職業(yè)規(guī)劃試題及答案
- 有限空間應(yīng)急演練方案
- 統(tǒng)編版語文三年級下冊第二單元復(fù)習(xí)課 課件
- 農(nóng)地犁地合同范本
- 高中生物滬科版課本“思考與討論”課件
- 2025年度數(shù)據(jù)中心10kv配電設(shè)備維保服務(wù)合同3篇
- GB/T 42968.4-2024集成電路電磁抗擾度測量第4部分:射頻功率直接注入法
- 銀行法律案例培訓(xùn)課件
- 產(chǎn)褥期感染病人護(hù)理
- 《大數(shù)據(jù)導(dǎo)論》期末考試復(fù)習(xí)題庫(含答案)
評論
0/150
提交評論