基于JAVA的学生成绩管理系统源代码.docx

上传人:b****4 文档编号:26866894 上传时间:2023-06-23 格式:DOCX 页数:20 大小:17.89KB
下载 相关 举报
基于JAVA的学生成绩管理系统源代码.docx_第1页
第1页 / 共20页
基于JAVA的学生成绩管理系统源代码.docx_第2页
第2页 / 共20页
基于JAVA的学生成绩管理系统源代码.docx_第3页
第3页 / 共20页
基于JAVA的学生成绩管理系统源代码.docx_第4页
第4页 / 共20页
基于JAVA的学生成绩管理系统源代码.docx_第5页
第5页 / 共20页
点击查看更多>>
下载资源
资源描述

基于JAVA的学生成绩管理系统源代码.docx

《基于JAVA的学生成绩管理系统源代码.docx》由会员分享,可在线阅读,更多相关《基于JAVA的学生成绩管理系统源代码.docx(20页珍藏版)》请在冰豆网上搜索。

基于JAVA的学生成绩管理系统源代码.docx

基于JAVA的学生成绩管理系统源代码

Java程序设计

专业

班级

学号

15号

姓名

刘振基

题目

学生成绩管理系统

任课教师

彭杰

一:

要求

1、用到书上(课本或实验册)上的至少三个实例

2、用到至少两种布局和至少四种组件

3、用到对话框

4、用到对数据库的查询、删除、添加和修改

5、最好用到输入输出流

6、具有一定的实际意义

二:

内容

本系统用access作为数据库,用到了书上的布局实例和数据库连接实例

功能:

1、输入十个同学的学号,姓名,出生日期,二科成绩(学,大学英语)。

2、输入学号查询学生信息。

3、删除记录

4、查询记录

5、添加记录

6、修改记录

三:

代码

第一部分:

publicclassmain{

publicstaticvoidmain(String[]args){

zhuchuangkouwin=newzhuchuangkou();

}

}

第二部分主界面:

import.*;

import.*;

publicclasszhuchuangkouextendsFrameimplementsActionListener{

Buttonbutton1,button2,button3,button4,tuichu;

Panelp1,p2,p3;

Labell1,l2,l3;

TextFielda1,a2;

Boxb1,b2,b3,b4,b5;

sss;

zhuchuangkou(){

button1=newButton("登陆");

button2=newButton("删除");

button3=newButton("修改");

button4=newButton("添加");

tuichu=newButton("退出");

p1=newPanel();

p2=newPanel();

p3=newPanel();

l1=newLabel("学生成绩管理",;

(newFont("宋体",,72));

;

l2=newLabel("登录名");

l3=newLabel("密码");

a1=newTextField(10);

a2=newTextField(10);

('*');

b1=();

(l2);

(8));

(l3);

b2=();

(a1);

(8));

(a2);

b4=();

(button1);

(10));

(tuichu);

b3=();

(b1);

(10));

(b2);

b5=();

(b3);

(8));

(b4);

(this);

(this);

(this);

(this);

(this);

(l1);

(b5);

add(p1,;

add(p2,;

add(p3,;

addWindowListener(newWindowAdapter(){

publicvoidwindowClosing(WindowEvente){

dispose();

}

});

setBackground;

setBounds(10,10,1000,500);

setVisible(true);

validate();

}

publicvoidactionPerformed(ActionEvente){

if()==tuichu){

(0);

}

if()==button1){

if().equals("liuzhenji")&&().equals("123456")){

newchuankou();

dispose();

}

else{

}

}

}

}

第三部分选择操作:

import.*;

import.*;

publicclasszhuchuangkouextendsFrameimplementsActionListener{

Buttonbutton1,button2,button3,button4,tuichu;

Panelp1,p2,p3;

Labell1,l2,l3;

TextFielda1,a2;

Boxb1,b2,b3,b4,b5;

sss;

zhuchuangkou(){

button1=newButton("登陆");

button2=newButton("删除");

button3=newButton("修改");

button4=newButton("添加");

tuichu=newButton("退出");

p1=newPanel();

p2=newPanel();

p3=newPanel();

l1=newLabel("学生成绩管理",;

(newFont("宋体",,72));

;

l2=newLabel("登录名");

l3=newLabel("密码");

a1=newTextField(10);

a2=newTextField(10);

('*');

b1=();

(l2);

(8));

(l3);

b2=();

(a1);

(8));

(a2);

b4=();

(button1);

(10));

(tuichu);

b3=();

(b1);

(10));

(b2);

b5=();

(b3);

(8));

(b4);

(this);

(this);

(this);

(this);

(this);

(l1);

(b5);

add(p1,;

add(p2,;

add(p3,;

addWindowListener(newWindowAdapter(){

publicvoidwindowClosing(WindowEvente){

dispose();

}

});

setBackground;

setBounds(10,10,1000,500);

setVisible(true);

validate();

}

publicvoidactionPerformed(ActionEvente){

if()==tuichu){

(0);

}

if()==button1){

if().equals("liuzhenji")&&().equals("123456")){

newchuankou();

dispose();

}

else{

}

}

}

}

第四部分查询界面实现:

import.*;

import.*;

publicclassssextendsFrameimplementsTextListener,ActionListener{

Buttonxunzhao;

TextFieldinput;

TextAreashow;

Strings;

intk;

Connectioncon;

Statementsql;

intsum=0;

ResultSetrs;

ss(){

Panelp=newPanel();

xunzhao=newButton("查找");

input=newTextField(10);

show=newTextArea(6,43);

(newLabel("输入学号"));

(input);

(xunzhao);

(this);

(this);

(false);

add(p,;

add(show,;

setBounds(10,30,500,200);

setVisible(true);

validate();

addWindowListener(newWindowAdapter(){

publicvoidwindowClosing(WindowEvente){

dispose();

}

});

}

publicvoidactionPerformed(ActionEventee){

booleanboo=true;

s=();

k=(s);

catch(ClassNotFoundExceptioneee)

;}

try{con=("jdbc:

odbc:

sun","gxy","123");

sql=();

rs=("SELECT*FROMchengjibiao");

while())

{

intnumber=("number");

Stringname=("name");

Stringdate=("birthday");

intmath=("math");

intenglish=("english");

if(number==k)

{boo=false;

(null);

("学号:

"+number+"姓名:

"+name+"出生:

"+date+"数学"+math+"英语"+english);

("\n");

}

}

();

if(boo){

(this,"你输入的学号不存在");

}

}

catch(SQLExceptioneee)

}

}

}

第五部分删除:

import.*;

import.*;

publicclassshanchuextendsFrameimplementsTextListener,ActionListener{

Buttonxunzhao;

TextFieldinput;

TextAreashow;

Strings;

intk,s1,j;

Connectioncon;

Statementsql;

intsum=0;

ResultSetrs;

shanchu(){

Panelp=newPanel();

xunzhao=newButton("删除");

input=newTextField(10);

show=newTextArea(6,43);

(newLabel("输入要删除的"+"学号"));

(input);

(xunzhao);

(this);

(this);

(false);

add(p,;

add(show,;

setBounds(10,30,500,200);

setVisible(true);

validate();

addWindowListener(newWindowAdapter(){

publicvoidwindowClosing(WindowEvente){

dispose();

}

});

}

publicvoidactionPerformed(ActionEventee){

booleanboo=true;

s=();

k=(s);

Stringm,dir;

}

catch(ClassNotFoundExceptioneee)

}

try{con=("jdbc:

odbc:

sun","gxy","123");

sql=();

rs=("SELECT*FROMchengjibiao");

while())

{intnumber=

(2);

Stringname=(3);

Stringdate=("birthday");

intmath=("math");

intenglish=("english");

if(number==k){

("你删除了:

");

("学号:

"+number+"姓名:

"+name+"出生:

"+date+"数学"+math+"英语"+english);

("\n");

m="DELETEFROMchengjibiaoWHEREnumber="+k+"";

(m);

}

}

();

}

catch(SQLExceptione)

}

}

}

第六部分修改:

import.*;

import.*;

publicclassxiugaiextendsFrameimplementsTextListener,ActionListener{

Buttoncharu;

TextFieldinput1,input2,input3,input4,input5,input6;

TextAreashow;

Panelp1,p2;

intk,s1,j;

Connectioncon;

Statementsql;

intsum=0;

ResultSetrs;

xiugai(){

p1=newPanel();

p2=newPanel();

charu=newButton("修改");

input1=newTextField(10);

input2=newTextField(10);

input3=newTextField(10);

input4=newTextField(10);

input5=newTextField(10);

input6=newTextField(10);

show=newTextArea(6,43);

(newLabel("请输入要修改的学号"));

(newLabel("number"));

(input1);

(newLabel("请输入修改的数据"));

(newLabel("name"));

(input2);

(newLabel("date"));

(input3);

(newLabel("math"));

(input4);

(newLabel("english"));

(input5);

(charu);

(this);

(this);

(false);

add(p1,;

add(p2,;

setBounds(10,30,1200,200);

setVisible(true);

validate();

addWindowListener(newWindowAdapter(){

publicvoidwindowClosing(WindowEvente){

dispose();

}

});

}

publicvoidactionPerformed(ActionEventee){

booleanboo=true;

Strings0,s1,s2,s3,s4,s5,insert1,recode,name,date;

intm0,m1,m2,m3,number,math,english;

s1=();

m1=(s1);

number=m1;

s4=();

m2=(s4);

math=m2;

s5=();

m3=(s5);

english=m3;

}

catch(ClassNotFoundExceptioneee)

}

try{con=("jdbc:

odbc:

sun","gxy","123");

sql=();

recode="("+m0+","+number+","+"'"+name+"'"+","+"'"+date+"'"+","+math+","+english+")";

insert1="UPDATEchengjibiaoSETmath="+math+",english="+english+"WHEREnumber="+number+"";

(insert1);

}catch(SQLExceptione)

}

}

}

第七部分添加:

import.*;

import.*;

publicclasscharuextendsFrameimplementsTextListener,ActionListener{

Buttoncharu;

TextFieldinput1,input2,input3,input4,input5,input6;

TextAreashow;

intk,s1,j;

Connectioncon;

Statementsql;

intsum=0;

ResultSetrs;

charu(){

Panelp=newPanel();

charu=newButton("插入");

input1=newTextField(10);

input2=newTextField(10);

input3=newTextField(10);

input4=newTextField(10);

input5=newTextField(10);

input6=newTextField(10);

show=newTextArea(6,43);

(newLabel("请输入要插入的数据"));

(newLabel("ID"));

(input6);

(newLabel("number"));

(input1);

(newLabel("name"));

(input2);

(newLabel("date"));

(input3);

(newLabel("math"));

(input4);

(newLabel("english"));

(input5);

(charu);

(this);

(this);

(false);

add(p,;

add(show,;

setBounds(10,30,1200,200);

setVisible(true);

validate();

addWindowListener(newWindowAdapter(){

publicvoidwindowClosing(WindowEvente){

dispose();

}

});

}

publicvoidactionPerformed(ActionEventee){

booleanboo=true;

Strings0,s1,s2,s3,s4,s5,insert1,recode,name,date;

intm0,m1,m2,m3,number,math,english;

s0=();

m0=(s0);

s1=();

m1=(s1);

number=m1;

s2=();

name=s2;

s3=();

date=s3;

s4=();

m2=(s4);

math=m2;

s5=();

m3=(s5);

english=m3;

}

catch(ClassNotFoundExceptioneee)

}

try{con=("jdbc:

odbc:

sun","gxy","123");

sql=();

recode="("+m0+","+number+","+"'"+name+"'"+","+"'"+date+"'"+","+math+","+english+")";

insert1="INSERTINTOchengjibiaoVALUES"+recode;

(insert1);

("你插入了:

");

("学号:

"+number+"姓名:

"+name+"出生:

"+date+"数学"+math+"英语"+english);

("\n");

}

catch(SQLExceptione)

(this,"你输入的不正确");

}

}

}

四:

运行效果

五总结:

本次课程设计,让我获益匪浅,不仅更深入的了解Java这门学科,更使自己有了继续探索的兴趣。

于个人而言,在程序设计的过程中,我深感“认真严谨”这个词的重要性,一点点小的马虎,便会导致整个程序不能正常运行。

在今后的学习中,我定将“认真严谨时刻作为自的谨言。

与此同时,本小组成员的互帮互助,让我体会到了团结的力量,而更让人难以忘怀的是在热烈讨论问题时,那激情横溢的场面。

总之,此次课程设计在我的学生生涯中启上了至关重要的作用。

最后,真诚的感谢彭老师的指导和教诲。

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

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1