收藏 分销(赏)

java学籍标准管理系统源代码.doc

上传人:w****g 文档编号:2993121 上传时间:2024-06-12 格式:DOC 页数:8 大小:24.04KB
下载 相关 举报
java学籍标准管理系统源代码.doc_第1页
第1页 / 共8页
java学籍标准管理系统源代码.doc_第2页
第2页 / 共8页
java学籍标准管理系统源代码.doc_第3页
第3页 / 共8页
java学籍标准管理系统源代码.doc_第4页
第4页 / 共8页
java学籍标准管理系统源代码.doc_第5页
第5页 / 共8页
点击查看更多>>
资源描述

1、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; JPanel pCent

2、er,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; CardLayout card=null;

3、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(提交); btnReset = new Button(重置); guanbi=new Button(关闭); p11=new

4、 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.addActionListener(this); p13.add(btnSubmit); btnSubmit.setBackground(Color.YELLOW); p13.add(btnRe

5、set); btnReset.setBackground(Color.YELLOW); 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.setBac

6、kground(Color.gray); p9=new JPanel(); icon=new ImageIcon(123.jpg); label2=new JLabel(icon,JLabel.LEFT); label=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

7、(录入学生基础信息); 修改=new JMenuItem(修改学生基础信息); 查询=new JMenuItem(查询学生基础信息); 删除=new JMenuItem(删除学生基础信息); 欢迎=new JMenuItem(欢迎界面); 退出=new JMenuItem(退出); 相关=new JMenuItem(相关我们); bar=new JMenuBar(); fileMenu=new JMenu(菜单选项); fileMenu.add(录入); fileMenu.add(修改); fileMenu.add(查询); fileMenu.add(删除); fileMenu.add(欢迎)

8、; fileMenu.add(相关); fileMenu.add(退出); fileMenu.enable(false); bar.add(fileMenu); setJMenuBar(bar); 基础信息=new Hashtable(); 录入.addActionListener(this); 修改.addActionListener(this); 查询.addActionListener(this); 删除.addActionListener(this); 欢迎.addActionListener(this); 退出.addActionListener(this); 相关.addActio

9、nListener(this); card=new CardLayout(); con=getContentPane(); pCenter=new JPanel(); pCenter.setLayout(card); pCenter.setBackground(Color.black); file=new File(作业.txt); if(!file.exists() try FileOutputStream out=new FileOutputStream(file); ObjectOutputStream objectOut=new ObjectOutputStream(out); obj

10、ectOut.writeObject(基础信息); objectOut.close(); out.close(); catch(IOException 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(修改界

11、面,基础信息修改); pCenter.add(删除界面,基础信息删除); 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.setT

12、ext();SuppressWarnings(deprecation)public void submit()String n=txtName.getText();String paw=txtPassword.getText();if(n.equals(admin) & paw.equals(1234)JOptionPane.showMessageDialog(this,正当用户,欢迎进入本系统);card.show(pCenter,欢迎语界面);fileMenu.enable();elseJOptionPane.showMessageDialog(this,非法用户,严禁进入本系统);pub

13、lic 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(e.getSource()=删除) card.show(pCenter,删除界面); else if(e.getSource()=欢迎) card.show(pCenter,欢迎语界面); else if(e

14、.getSource()=退出) System.exit(0); else if(e.getSource()=相关) JOptionPane.showMessageDialog(this,五块二小组:常永恒,孙东升,李强,吴春亮,涂留定); String s=e.getActionCommand();if(s.equals(重置)clear();else if(s.equals(提交)submit();else if(e.getSource()=txtName)txtPassword.requestFocus();else if(e.getSource()=txtPassword)submit();else if(s.equals(关闭)System.exit(0); public static void main(String args) new ManagerWindow();

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 通信科技 > 开发语言

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服