基于JAVA的学生成绩管理系统源代码文档格式.docx
《基于JAVA的学生成绩管理系统源代码文档格式.docx》由会员分享,可在线阅读,更多相关《基于JAVA的学生成绩管理系统源代码文档格式.docx(21页珍藏版)》请在冰豆网上搜索。
3、用到对话框
4、用到对数据库的查询、删除、添加和修改
5、最好用到输入输出流
6、具有一定的实际意义
二:
内容
本系统用access作为数据库,用到了书上的布局实例和数据库连接实例
功能:
1、输入十个同学的学号,姓名,出生日期,二科成绩(学,大学英语)。
2、输入学号查询学生信息。
3、删除记录
4、查询记录
5、添加记录
6、修改记录
三:
代码
第一部分:
publicclassmain{
publicstaticvoidmain(String[]args){
zhuchuangkouwin=newzhuchuangkou();
}
}
第二部分主界面:
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);
(a2);
b4=();
(button1);
(10));
(tuichu);
b3=();
(b1);
(b2);
b5=();
(b3);
(b4);
(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"
else{
nishurucuowu"
第三部分选择操作:
第四部分查询界面实现:
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);
(false);
add(p,;
add(show,;
setBounds(10,30,500,200);
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)
{}
}
第五部分删除:
importclassshanchuextendsFrameimplementsTextListener,ActionListener{
intk,s1,j;
shanchu(){
Panel