java学籍管理系统源代码.docx

上传人:b****2 文档编号:1891304 上传时间:2023-05-02 格式:DOCX 页数:9 大小:73.67KB
下载 相关 举报
java学籍管理系统源代码.docx_第1页
第1页 / 共9页
java学籍管理系统源代码.docx_第2页
第2页 / 共9页
java学籍管理系统源代码.docx_第3页
第3页 / 共9页
java学籍管理系统源代码.docx_第4页
第4页 / 共9页
java学籍管理系统源代码.docx_第5页
第5页 / 共9页
java学籍管理系统源代码.docx_第6页
第6页 / 共9页
java学籍管理系统源代码.docx_第7页
第7页 / 共9页
java学籍管理系统源代码.docx_第8页
第8页 / 共9页
java学籍管理系统源代码.docx_第9页
第9页 / 共9页
亲,该文档总共9页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

java学籍管理系统源代码.docx

《java学籍管理系统源代码.docx》由会员分享,可在线阅读,更多相关《java学籍管理系统源代码.docx(9页珍藏版)》请在冰点文库上搜索。

java学籍管理系统源代码.docx

java学籍管理系统源代码

java学籍管理系统源代码

packagezuoye;

//主类

importjava.awt.*;

importjava.awt.event.*;

importjavax.swing.*;

importjava.io.*;

importjava.util.Hashtable;

publicclassManagerWindowextendsJFrameimplementsActionListener

{

InputStudent基本信息录入=null;

ModifySituation基本信息修改=null;

Inquest基本信息查询=null;

Delete基本信息删除=null;

JPanelpCenter,p,p9;

TextFieldtxtName,txtPassword;

LabellblTitle,lblName,lblPassword;

ButtonbtnSubmit,btnReset,guanbi;

Panelp1,p11,p12,p2,p13,p14,p15;

JMenuBarbar;

ImageIconicon;

JMenufileMenu;

p.add(p11);

p.add(p12);

p.add(p13);

p.setBackground(Color.gray);

p9=newJPanel();

icon=newImageIcon("123.jpg");

label2=newJLabel(icon,JLabel.LEFT);

label=newJLabel("欢迎使用学生基本信息管理系统",JLabel.CENTER);

label.setFont(newFont("TimesRoman",Font.BOLD,24));

label.setForeground(Color.red);

p9.setOpaque(true);

p9.add(label);

p9.add(label2);

录入=newJMenuItem("录入学生基本信息");

修改=newJMenuItem("修改学生基本信息");

查询=newJMenuItem("查询学生基本信息");

删除=newJMenuItem("删除学生基本信息");

欢迎=newJMenuItem("欢迎界面");

退出=newJMenuItem("退出");

关于=newJMenuItem("关于我们");

bar=newJMenuBar();

fileMenu=newJMenu("菜单选项");

fileMenu.add(录入);

fileMenu.add(修改);

fileMenu.add(查询);

fileMenu.add(删除);

fileMenu.add(欢迎);

fileMenu.add(关于);

fileMenu.add(退出);

fileMenu.enable(false);

bar.add(fileMenu);

setJMenuBar(bar);

基本信息=newHashtable();

录入.addActionListener(this);

修改.addActionListener(this);

查询.addActionListener(this);

删除.addActionListener(this);

欢迎.addActionListener(this);

退出.addActionListener(this);

关于.addActionListener(this);

card=newCardLayout();

con=getContentPane();

pCenter=newJPanel();

pCenter.setLayout(card);

pCenter.setBackground(Color.black);

file=newFile("作业.txt");

if(!

file.exists())

{

try{

FileOutputStreamout=newFileOutputStream(file);

ObjectOutputStreamobjectOut=newObjectOutputStream(out);

objectOut.writeObject(基本信息);

objectOut.close();

out.close();

}

catch(IOExceptione)

{

}

}

基本信息录入=newInputStudent(file);

基本信息修改=newModifySituation(file);

基本信息查询=newInquest(this,file);

基本信息删除=newDelete(file);

pCenter.add(p,BorderLayout.CENTER);

pCenter.add("欢迎语界面",p9);

pCenter.add("录入界面",基本信息录入);

pCenter.add("修改界面",基本信息修改);

pCenter.add("删除界面",基本信息删除);

con.add(pCenter,BorderLayout.CENTER);

con.validate();

addWindowListener(newWindowAdapter()

{publicvoidwindowClosing(WindowEvente)

{

System.exit(0);

}

});

setVisible(true);

setBounds(500,200,450,400);

validate();

}

publicvoidclear(){

txtName.setText("");

txtPassword.setText("");

}

@SuppressWarnings("deprecation")

publicvoidsubmit(){

Stringn=txtName.getText();

Stringpaw=txtPassword.getText();

if(n.equals("admin")&&paw.equals("1234")){

JOptionPane.showMessageDialog(this,"合法用户,欢迎进入本系统");

card.show(pCenter,"欢迎语界面");

fileMenu.enable();

}else{

JOptionPane.showMessageDialog(this,"非法用户,禁止进入本系统");

}

}

 

publicvoidactionPerformed(ActionEvente)

{

if(e.getSource()==录入)

{

card.show(pCenter,"录入界面");

}

elseif(e.getSource()==修改)

{

card.show(pCenter,"修改界面");

}

elseif(e.getSource()==查询)

{

基本信息查询.setVisible(true);

}

elseif(e.getSource()==删除)

{

card.show(pCenter,"删除界面");

}

elseif(e.getSource()==欢迎)

{

card.show(pCenter,"欢迎语界面");

}

elseif(e.getSource()==退出)

{

System.exit(0);

}

elseif(e.getSource()==关于)

{

JOptionPane.showMessageDialog(this,"五块二小组:

常永恒,孙东升,李强,吴春亮,涂留定");

}

Strings=e.getActionCommand();

if(s.equals("重置")){

clear();

}elseif(s.equals("提交")){

submit();

}elseif(e.getSource()==txtName){

txtPassword.requestFocus();

}elseif(e.getSource()==txtPassword){

submit();

}

elseif(s.equals("关闭")){

System.exit(0);

}

}

publicstaticvoidmain(Stringargs[])

{

newManagerWindow();

}

}

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 人文社科

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2