下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 中国建筑材料联合会:低碳胶凝材料技术及应用交流会会议报告
- (2026年)院感外科工作计划
- 2026上岗考核试卷附答案
- 链条装配工班组考核评优考核试卷含答案
- 保温材料制品生产工安全宣传能力考核试卷含答案
- 炭素煅烧操作工岗前工作效率考核试卷含答案
- 印花工安全生产规范竞赛考核试卷含答案
- 船舶水手安全生产能力考核试卷含答案
- 三氯硅烷生产工技术落地水平考核试卷含答案
- 稀硝酸工教育考核试卷含答案
- 2026年沈阳鼓风机集团股份有限公司人员招聘笔试参考题库及详细答案解析
- 防止返贫动态监测帮扶培训
- (2.1)-第二章 绦虫的结构预防兽医学实验
- 2026秋新教材人教版六年级上册美术全册教案
- 2026年秋季小学道德与法治三年级上册(新教材)教学计划含教学进度表
- 2026年秋季学期人教版(新教材)初中生物学八年级上册教学计划及进度表
- 矿产资源勘查实施方案编写提纲及解读
- 2026年艾滋病知识竞赛试题及答案
- 《自我保护免受伤害》教学课件 - 2026-2027 学年统编版(新教材)小学道德与法治四年级上册
- 2027年法律硕士(非法学)专业课模拟卷(两套含解析)
- (2026年)急性胰腺炎急诊诊断及治疗专家共识课件
评论
0/150
提交评论