版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、package zuoye;/主类public class ManagerWindow extends JFrame implements ActionListener InputStudent 基本信息录入 =null;ModifySituation 基本信息修改 =null;Inquest基本信息查询 =null;Delete基本信息删除 =null;JPanel pCenter,p,p9; TextField txtName,txtPassword;Label lblTitle,lblName,lblPassword;Button btnSubmit,btnReset,guanbi;Pa
2、nel 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;JLabel label2;public ManagerWindow()p=new JPanel(); lblName=new Label(" 管理员帐号 :");
3、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 Pan
4、el(); p14=new Panel(); p15=new Panel();p11.add(lblName);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
5、); p13.add(guanbi);guanbi.setBackground(Color.YELLOW); btnSubmit.addActionListener(this); btnReset.addActionListener(this); guanbi.addActionListener(this);p.setLayout(new GridLayout(10,1); p.add(p14);p.add(p15);p.add(p11);p.add(p12); p.add(p13); p.setBackground(Color.gray); p9=new JPanel();",JL
6、abel.CENTER);icon=new ImageIcon("123.jpg"); label2=new JLabel(icon,JLabel.LEFT); label=new JLabel(" 欢迎使用学生基本信息管理系统 label.setFont(new Font("TimesRoman",Font.BOLD,24); label.setForeground(Color.red);p9.setOpaque(true); p9.add(label); p9.add(label2);录入 =new JMenuItem(" 录入学
7、生基本信息 "); 修改 =new JMenuItem(" 修改学生基本信息 "); 查询 =new JMenuItem(" 查询学生基本信息 "); 删除 =new JMenuItem(" 删除学生基本信息 "); 欢迎 =new JMenuItem(" 欢迎界面 ");退出 =new JMenuItem(" 退出 "); 关于 =new JMenuItem(" 关于我们 ");bar=new JMenuBar(); fileMenu=new JMenu(&quo
8、t; 菜单选项 "); fileMenu.add( 录入 ); fileMenu.add( 修改 ); fileMenu.add( 查询 ); fileMenu.add( 删除 ); fileMenu.add( 欢迎 ); fileMenu.add( 关于 ); fileMenu.add( 退出 );fileMenu.enable(false); bar.add(fileMenu); setJMenuBar(bar); 基本信息 =new Hashtable(); 录入 .addActionListener(this); 修改 .addActionListener(this); 查询
9、 .addActionListener(this); 删除 .addActionListener(this); 欢迎 .addActionListener(this); 退出 .addActionListener(this); 关于 .addActionListener(this); card=new CardLayout(); con=getContentPane(); pCenter=new JPanel(); pCenter.setLayout(card); pCenter.setBackground(Color.black); file=new File(" 作业 .txt&
10、quot;);if(!file.exists() tryFileOutputStream out=new FileOutputStream(file); ObjectOutputStream objectOut=new ObjectOutputStream(out); objectOut.writeObject( 基本信息 );objectOut.close(); out.close();catch(IOException e) 基本信息录入 =new InputStudent(file); 基本信息修改 =new ModifySituation(file); 基本信息查询 =new Inqu
11、est(this,file); 基本信息删除 =new Delete(file); pCenter.add(p,BorderLayout.CENTER); pCenter.add(" 欢迎语界面 ",p9); pCenter.add(" 录入界面 ", 基本信息录入 ); pCenter.add(" 修改界面 ", 基本信息修改 ); pCenter.add(" 删除界面 ",基本信息删除 ); con.add(pCenter,BorderLayout.CENTER); con.validate();addWind
12、owListener(new WindowAdapter() public void windowClosing(WindowEvent e)System.exit(0);sef<sib-e(=rue= se60ounds(500-200-450-400= va-idafep pub=c void c-eao宀 txfName.sefrexw-)八 txf Password - seHexf(J- suppresswarnings(=deprecafion=) pub=c void submio宀 Shing nutxzame.gefrexp Shing pawllxfpassword.
13、gefrexp if(n.equa-s(=admin=)QOQOpaw.equa-s(=1234=)宀 Jopfionpane.showMessageDia-ogahis-n>m济©>>淤-)card.show(pcenfer-=济sSMa fi-eMenu.enab-epe-se 宀 Jopfionpane.showMessageDia-ogahis-卅并百>>lEB>>wf-)pub-ic void acfionPerformed(ACHOnEvenf e)ifGgefsource?"知>) 宀card.show(pcen
14、(Dr-=漁 >训|= e-se=h(e.gefsource(HHs)宀card.show(pcenfer-=感注训|= e-se=h(e.gefsource(HHmitj)宀>述、卿1<违.sefvisib-earuex e-se=h(e.gefsource(HH 崖那)宀card.show(pcenfer-=崖那训|= e-se=h(e.gefsource(HH 济告) card.show(pcenfer-=济sswa-) e-se if(e.gefsource(Hu 笳&) 宀 system. exiBxelse if(e.getSource()= 关于 )JOptionPane.showMessageDialog(this," 五块二小组:常永恒,孙东升,李强,吴春亮,涂留定 "); String s=e.getActionCommand();if(s.equals(" 重置 ")clear();else if(s.equals(&q
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 互联网诊室工作制度
- 人民日报社工作制度
- 企业青年团工作制度
- 中医卫生室工作制度
- 信息技术部工作制度
- 体育馆防火工作制度
- 办公室各类工作制度
- 加拿大食堂工作制度
- 劳动课教师工作制度
- 区妇幼保健工作制度
- 日本所有番号分类
- 非煤矿山各类人员职责制度操作规程
- 《中药调剂技术》中职全套教学课件
- 智能科学与技术专业建设思路
- 安全生产责任制课件
- 英语教学论文:利用“Big question”问题链探究单元主题意义
- 航空航天行业飞行安全与维护管理方案
- 2024年上海市浦东新区卫生系统招聘护士岗位考试《护理学》试题及答案
- 人工智能训练师理论知识考核要素细目表四级
- GB/T 36548-2024电化学储能电站接入电网测试规程
- NB-T35020-2013水电水利工程液压启闭机设计规范
评论
0/150
提交评论