




下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、欢迎阅读package zuoye;/主类import java.awt.*;import javax.swing.*;import java.io.*;public class ManagerWindow extends JFrame implements ActionListener InputStudent基本信息录入=null;ModifySituation 基本信息修改=null;Inquest基本信息查询=null;Delete基本信息删除=null;JPanel pCenter,p,p9;TextField txtName,txtPassword;Label lblTitle,l
2、blName,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;CardLayout card=null;JLabel label=null;儿abel label2;public ManagerWindow()p=new JPanel();l
3、blName=new Label(管理员帐号:);txtName=new TextField(10);lblPassword=new Label(密码:);txtPassword=new TextField(10);txtPassword.setEchoChar(*);btnSubmit = new Button(提交);btnReset = new Button(重置);guanbi=new Button(关闭)p11=new Panel();p12=new Panel();p13=new Panel();p14=new Panel();p15=new Panel();p11.add(lbl
4、Name);p11.add(txtName);欢迎阅读p12.add(lblPassword);p12.add(txtPassword);txtName.addActionListener(this);txtPassword.addActionListener(this);p13.add(btnSubmit);btnSubmit.setBackground(Color.YELLOW);p13.add(btnReset);btnReset.setBackground(Color.YELLOW);p13.add(guanbi);guanbi.setBackground(Color.YELLOW);
5、 btnSubmit.addActionListener(this);btnReset.addActionListener(this);guanbi.addActionListener(this);p.setLayout(new GridLayout(10,1);p.add(p14);p.add(p15);p.add(pll);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
6、=new JLabel(欢迎使用学生基本信息管理系统,JLabel.CENTER);label.setFont(new Font(TimesRoman,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(欢迎界面);退
7、出=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);setJMenuBar(bar);基本信息=new Hashtable();录入.addAct
8、ionListener(this);修改.addActionListener(this);查询.addActionListener(this);删除.addActionListener(this);欢迎.addActionListener(this);退出.addActionListener(this);关于.addActionListener(this);card=new CardLayout();con=getContentPane();pCenter=new JPanel();pCenter.setLayout(card);pCenter.setBackground(Color.blac
9、k);file=new File(作业.txt);if(!file.exists()tryFileOutputStream out=new FileOutputStream(file);ObjectOutputStream objectOut=new ObjectOutputStream(out);objectOut.writeObject(基本信息);objectOut.close();out.close();catch(IOException e)i 产 J F 1 I, I基本信息录入=new InputStudent(file);基本信息修改=new ModifySituation(f
10、ile);基本信息查询=new Inquest(this,file);基本信息删除=new Deletefile);pCenter.add(p,BorderLayout.CENTER);pCenter.add(欢迎语界面”,p9);pCenter.add(录入界面”,基本信息录入);pCenter.add(修改界面,基本信息修改);pCenter.add(删除界面,基本信息删除);con.add(pCenter,BorderLayout.CENTER);con.validate();addWindowListener(new WindowAdapter() public void window
11、Closing(WindowEvent e)System.exit(0););欢迎阅读setVisible(true);setBounds(500,200,450,400);validate。;public void clear()txtName.setText();txtPassword.setText();SuppressWarnings(deprecation)public void submit()String n=txtName.getText();String paw=txtPassword.getText();if(n.equals(admin) & paw.equals(123
12、4)JOptionPane.showMessageDialog(this,含法用户,欢迎进入本系统);card.show(pCenter,欢迎语界面);fileMenu.enable();elseJOptionPane.showMessageDialog(this非法用户,禁止进入本系统); public void actionPerformed(ActionEvent e) if(e.getSource()= 入)card.show(pCenter,录入界面);else if(e.getSource()=# 改)card.show(pCenter,修改界面);else if(e.getSou
13、rce()=S 询)基本信息查询.setVisible(true);else if(e.getSource()=H 除)card.show(pCenter,删除界面);else if(e.getSource(尸欢迎)card.show(pCenter,欢迎语界面);else if(e.getSource()=!出)System.exit(O);欢迎阅读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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB 4824-2025工业、科学和医疗设备射频骚扰特性限值和测量方法
- 2025废铜购销合同
- 商铺门面租赁合同
- 2025财务经理聘请的合同协议格式
- 办公大楼楼顶广告位租赁合同
- 面粉购销合同
- 五金购买合同
- 装饰装修工程质量保修合同范本
- 2025废弃土地租赁合同
- 德州律师合伙协议书
- 2025-2030全球及中国军事无线电系统行业市场现状供需分析及市场深度研究发展前景及规划可行性分析研究报告
- 配电工程施工方案
- 2025年中国光纤放大器行业竞争格局及市场发展潜力预测报告
- 护理礼仪中的称呼礼仪
- 2025年浙江纺织服装职业技术学院单招职业适应性测试题库新版
- 2025年河南省安阳市安阳县九年级中考一模数学试题(原卷版+解析版)
- 2024年河北省普通高中学业水平选择性考试物理试题含答案
- Unit 4 Healthy food(说课稿)-2024-2025学年人教PEP版(2024)英语三年级下册
- 海棠河外来植物防治与红树林湿地恢复项目环评报告书
- 牧运通备案办理流程
- 新版《医疗器械经营质量管理规范》(2024)培训试题及答案
评论
0/150
提交评论