




下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 幼兒園安全教育日主題班會
- 水利水電工程新項目評審試題及答案
- 2025年中級經濟師重要考點試題及回答
- 線護理工作總結與改進計劃
- 在c語言期末考試試題及答案
- 孵化跳水測試題及答案
- 醫(yī)療機構考試試題及答案
- 釣螃蟹面試題及答案
- 主管工作中的數(shù)據(jù)分析利用計劃
- 學校環(huán)境中的藝術裝置設計計劃
- 2025年下半年山東新華書店集團限公司德州分公司招聘20人易考易錯模擬試題(共500題)試卷后附參考答案
- 質量、環(huán)境、職業(yè)健康安全三合一程序文件
- 學校教輔征訂管理“三公開、兩承諾、一監(jiān)督”制度
- 2024-2025公司員工安全培訓考試試題及答案典型題
- 2025年全國國家版圖知識競賽(中小學組)題庫及答案(共五篇)匯編
- 2025年高考語文作文終極押題03 關于Deepseek(押題理由+作文真題++審題立意+高分范文)(全國)
- 抖音商務BD培訓
- 中馬欽州產業(yè)園管委會筆試試題
- 中藥處方培訓課件
- (高清版)DB12∕T 934-2020 公路工程資料管理技術規(guī)程
- 防火門工程驗收單模板
評論
0/150
提交評論