基于JAVA的学生成绩管理系统源代码.docx
- 文档编号:1440113
- 上传时间:2022-10-22
- 格式:DOCX
- 页数:21
- 大小:79.10KB
基于JAVA的学生成绩管理系统源代码.docx
《基于JAVA的学生成绩管理系统源代码.docx》由会员分享,可在线阅读,更多相关《基于JAVA的学生成绩管理系统源代码.docx(21页珍藏版)》请在冰豆网上搜索。
基于JAVA的学生成绩管理系统源代码
ThelatestrevisiononNovember22,2020
基于JAVA的学生成绩管理系统源代码
Java程序设计
系
专业
班级
学号
15号
姓名
刘振基
题目
学生成绩管理系统
任课教师
彭杰
一:
要求
1、用到书上(课本或实验册)上的至少三个实例
2、用到至少两种布局和至少四种组件
3、用到对话框
4、用到对数据库的查询、删除、添加和修改
5、最好用到输入输出流
6、具有一定的实际意义
二:
内容
本系统用access作为数据库,用到了书上的布局实例和数据库连接实例
功能:
1、输入十个同学的学号,姓名,出生日期,二科成绩(学,大学英语)。
2、输入学号查询学生信息。
3、删除记录
4、查询记录
5、添加记录
6、修改记录
三:
代码
第一部分:
publicclassmain{
publicstaticvoidmain(String[]args){
zhuchuangkouwin=newzhuchuangkou();
}
}
第二部分主界面:
import.*;
import.*;
importclasszhuchuangkouextendsFrameimplementsActionListener{
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();
"wwwww");
dispose();
}
else{
"nishurucuowu");
}
}
}
}
第三部分选择操作:
import.*;
import.*;
importclasszhuchuangkouextendsFrameimplementsActionListener{
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();
"wwwww");
dispose();
}
else{
"nishurucuowu");
}
}
}
}
第四部分查询界面实现:
import.*;
import.*;
importclassssextendsFrameimplementsTextListener,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);
try{("");}
catch(ClassNotFoundExceptioneee)
{""+eee);}
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.*;
importclassshanchuextendsFrameimplementsTextListener,ActionListener{
Buttonxunzhao;
TextFieldinput;
TextAreashow;
Strings;
intk,s1,j;
Connectioncon;
Statementsql;
intsum=0;
ResultSetrs;
shanchu(){
Panel
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 JAVA 学生 成绩管理系统 源代码
![提示](https://static.bdocx.com/images/bang_tan.gif)