《网络数据库》课程
设计
领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计
报告
目 录
1
1 需求分析
1
1.1 功能需求
1
1.2 系统的开发运行环境
1
2 总体设计
1
2.1 系统功能模块
1
2.2 主要类设计(子模块设计)
1
3 数据库设计
1
〔要求数据库设计完整,参考综合实验〕
3.1 数据表设计(要体现数据完整性)
2
3.2 存储过程与触发器设计
3
3.3 索引(视图)设计
4
3.4 安全性设计
4
4 详细设计
8
5.1 登录模块
8
5.2教师模块
11
5.3学生模块
13
5 小结和展望
15
参 考 文 献
15
附 录
15
使用说明
书
关于书的成语关于读书的排比句社区图书漂流公约怎么写关于读书的小报汉书pdf
15
需求分析
1.1 功能需求
我做的是学生成绩管理系统,设计到的主要用户有两大类,即教师和学生。
从学生的角度来看,需要实现的功能有查询基本信息,查询成绩,修改密码。这三项功能是学生成绩管理系统所必须具备的,其余功能可以具体分析是否添加。我做的系统的学生界面就是基于这三个功能进行的。
从教师的角度来看,需要实现的功能有录入学生基本信息,录入学生的各科成绩,修改教师登录系统的密码,以及修改学生成绩。
1.2 系统的开发运行环境
本系统开发平台: Java 或其他可视化高级语言+ sql servereclipse
本系统运行环境: windows 7
总体设计
2.1 系统功能模块
为了简化学生管理系统,将系统划分为三个模块,即:登录模块,教师模块,学生模块。
功能模块实现用户的登录,用户主要为两类:学生,教师。其中登录账号即为学生的学号与教师的教师号,学生的初始密码为123,教师的初始密码为教师号。登录系统之后要及时进行修改。
教师模块实现对学生成绩与基本信息的管理。即录入学生信息,录入学生成绩,修改成绩,修改密码
学生模块实现对信息的查询与更改,查询即为查询学生的基本信息,查询学生的成绩,以及更改密码。
系统总体结构图
2.2 主要类设计(子模块设计)
学生成绩管理系统由9个类组成,分别是:系统类,教师类,学生类,添加信息类,添加成绩类,修改成绩类,修改密码类,查询基本信息类,查询成绩类。
系统类实现用户的登录,验证用户的身份。学生的登录账号为学号,初始密码为123。教师的登录账号为教师号,初始密码为教师号。当登录账号输入有错时,系统会提示登录失败。
教师成功登录系统之后进入的是教师界面,教师自由的选择要实现的功能。教师可以录入学生的基本信息,录入学生的成绩,修改学生的成绩,修改教师的登录密码。教师选择录入学生的基本信息之后系统就弹出了录入信息类,通过添加学生的学号,姓名,性别,班级,学院,备注,出生年月,点击添加按钮实现向数据库添加学生信息。教师选择录入学生的成绩之后,录入成绩的界面弹出。教师根据学号,一次添加学生的各科成绩之后,点击添加实现向数据库中添加学生的成绩。同时教师也可以修改学生的成绩,因为考虑到教师的误操作,所以设置了修改学生成绩类。教师只要输入学号再加上要修改的学生的科目的成绩之后点击添加即可。为了避免账号被人随意登录,教师可在首次登录系统之后进行密码的修改。
学生成功登录系统之后进入的是学生界面,学生界面主要实现一些基本的查询功能,如查询学生的基本信息,查询学生的成绩,修改学生的登录密码等。学生选择查询基本信息之后系统随即弹出查询信息类的界面,学生不需要输入学号,点击查询即可。同时学生可以选择查询成绩,点击之后系统自动弹出查询成绩类的界面,学生不需要输入学号即可实现查询。因为学生成绩管理系统的初始登录密码为123,所以学生登录之后的第一件事是修改登录密码。
数据库设计
3.1 数据表设计(要体现数据完整性)
学生成绩管理系统共有四个表,分别是:学生表,成绩表,教师表,课程表。表的设计如下:
学生表(学号,姓名,性别,初始年月,专业班级,总学分,备注,班级,学校,密码);
教师表(教师号,姓名,性别,学校,密码);
课程表(课程号,课程名,教师号,学分,学时);
3.2 存储过程与触发器设计
存数过程是数据库对象之一,存储过程可以理解为数据库的子程序,在客户端和服务端可以使用它。触发器是与表直接关联的特殊的存储过程,是对表记录操作时触发的。在数据库设计过程中,均对存储过程和触发器进行了设计。
定义select * from xsb存储过程:
create procedure student_info as select * from xsb
exec student_info
定义select * from TCH 存储过程:
create procedure tch_info as select * from tch
exec tch_info
定义select * from xsb存储过程:
create procedure xsb_info_search as
select * from xsb where 学号 = '" + id + "'
创建触发器,当向学生表中插入一行数据时,提示“trigger is working”
create trigger xsb_insert on xsb after insert
as
begin declare @str char(50)
set @str='trigger is working'
print @str
end
创建触发器,当想xsb中插入一个学生的成绩时,将xsb表中的该学生的总学分加上添
加的课程的学分
create trigger cjb_insert on cjb after insert
as
begin
declare @num char(6),@kc_num char(3)
declare @xf int
select @num=kcb.学分,@kc_num=kcb.课程号 from inserted
select @xf=学分 from kcb where kcb.课程号=@kc_num
update xsb set 总学分=总学分+@xf where 学号=@num
print'修改成功'
End
创建触发器,当修改xsb表中的学号时,同时也要将cjb表中的学号修改成相应的学 号
create trigger xsb_update
on xsb after update
as
begin
declare @old_num char(6),@new_num char(6)
select @old_num=学号 from deleted
select @new_num=学号 from inserted
update cjb set 学号=@new_num where 学号=@old_num
end
创建xscjgl数据库作用域的ddl触发器,当删除一个表时,提示禁止该操作,然后回 滚删除表的操作。
create trigger safety
on database
after drop_table
as print '不能删除该表'
rollback transaction
创建服务器作用域的ddl触发器,当删除一个数据库时,提示禁止该操作并回滚删除数据库的操作。
create trigger safety_server_delete
on all server
after drop_database
as
print '不能删除该数据库'
rollback transaction
3.3 索引(视图)设计
Sql server中索引可以分为两类,即聚集索引和非聚集索引。索引是可以唯一的,这意味着不会有两行相同的索引键值,这样的索引称为唯一索引。聚集索引将数据行的键值在表内排序并存储对应的数据记录,使得数据表物理顺序与索引顺序一致。非聚集完全独立于数据行的结构。
本系统使用的是唯一索引,这是因为考虑到每个表中都不允许出现两行一样的值,约束输入数据的正确
规范
编程规范下载gsp规范下载钢格栅规范下载警徽规范下载建设厅规范下载
,保证数据的完整性。
创建唯一聚集索引:
create unique clustered index xsb_id_ind on xsb(学号)
create unique clustered index tch_id_ind on tch(教师号)
create unique clustered index cjb_id_ind on cjb(学号)
3.4 安全性设计
对于学生成绩管理系统的安全性设计,我是从两个方面去考虑的。其一是数据库的备份与恢复。其二是系统安全管理。
创建备份:在本地硬盘上创建一个备份文件,备份设备的逻辑名是mybackupfile
exec sp_addumpdevice 'disk','mybackupfile',
'e:\data\mybackupfile.bak'
sql 执行差异备份时应注意一下几点:
(1)若在上次完全数据库备份之后,数据库的某行被修改了,则执行差异备份至保存最后一次的修改。
(2)为了是差异备份设备与完全数据库备份设备区分开来,应使用不同的备份设备名。
backup database xscjgl to disk='e:\data\xscjgl.bak' with differential
创建一个命名的备份设备xscjgllogbk,并备份xscjgl数据库的事务日志
exec sp_addumpdevice 'disk','xscjgllogbk','e:\data\xscjgllog.bak'
backup log xscjgl to xscjgllogbk
如果数据库遭到破坏或者毁坏导致数据丢失,则可以使用备份设备进行备份:
backup database xscjgl to mybackupfile
恢复数据库:
restore database xscjgl from mybackupfile
with norecovery ,replace
restore log xscjgl from xscjgllogbk
创建sql server登录名manager1,密码,manager2,密码,默认数据库设为xscjgl
create login manager1
with password='542542',
default_database=xscjgl
create login manager2
with password='111222',
default_database=xscjgl
使用sql server登录名manager1在xscjgl数据库中创建数据库用户名tao ,默认架构名使用dbo。 使用sql server登录名manager2在xscjgl数据库中创建数据库用户名su ,默认架构名使用dbo。
create user tao for login manager1 with default_schema=dbo
create user su for login manager2 with default_schema=dbo
详细设计
5.1 登录模块
功能设计
在已经设计好的界面中的相应地方输入账号,密码,选择是学生还是老师。在以上的都填写完毕之后点击登录,完成登录。学生的登录账号为学号,初始密码也为学号。教师的登录账号为教师号,初始密码也为教师号。用户可以在首次登录之后进行更改密码,以保证信息安全。
界面设计
界面设计力求简洁,在简单的验证过身份之后即进入系统。登录界面没有做过多的身份认证,主要考虑到学生成绩管理系统是在学校内部使用,是在校内网,所以能登录的只是学校的老师或学生。界面顶部用的是带有华北科技学院学院的名字的图片。
登录界面截图:
3模块算法(或重要代码段)
if(xsb.isSelected())
{
try
{
Connection con = DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=xscjgl","sjs","1234");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("exec student_info");
while(rs.next())
{
if(rs.getString("学号").equals(username))
if((rs.getString("密码").equals(password)))
{save.user=username;
save.userpassword=password;
JOptionPane.showMessageDialog(ss,rs.getString("姓名")+"同学!您好!欢迎登录教师管理系统!");
Students stu = new Students();
}
else
{
JOptionPane.showMessageDialog(ss,"登录失败");
}
}//处理完之后释放资源。
rs.close();
stmt.close();
}//传说中的抛出异常。。。
catch (SQLException se)
{
JOptionPane.showMessageDialog(ss,se.getMessage());
}
}
else if(tch.isSelected())
{
try
{
Connection con = DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=xscjgl","sjs","1234");
Statement stmt = con.createStatement();
String id = null;
ResultSet rs = stmt.executeQuery("select * from TCH");
while(rs.next())
{
if(rs.getString("教师号").equals(username))
if((rs.getString("密码").equals(password)))
{
JOptionPane.showMessageDialog(ss,rs.getString("姓名")+"老师!您好!欢迎登录教师管理系统!");
Teachers tch=new Teachers();//"登陆成功"
}
else
{
JOptionPane.showMessageDialog(ss, "登录失败");
}
4调试与测试
学生成绩管理系统的界面部分是在数据库设计完成之后才开始进行的。数据库中保存着用户的数据,其中就包括用户的登录账号和密码。数据库建立成功之后面临的第一个大的问
题
快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题
就是eclipse和数据库的连接问题。在eclipse上编写代码的过程中,由于各个模块写的时间都比较长,所以遇到的问题都能够解决了,碰到大的自己解决不了的也都请教了同学。其中有一个子程序是报错一直找不到主类,我调试了好长时间一直发现不了哪里出了问题,最后在请教张永真之后得到了答案。因为主类被一个子类包在了大括号里,所以程序一直无法找到主类,所以程序也就无法正常运行了。
5.2 教师模块
功能设计
教师模块实现的功能有录入学生的基本信息,录入学生的成绩,修改学生的成绩,修改教师的登录密码等。
界面设计
教师界面:
添加学生的基本信息:
添加学生成绩: 修改学生成绩:
修改教师登录密码:
3模块算法(或重要代码段)
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==item1)
{
AddMsg msg = new AddMsg();
}
else if(e.getSource()==item2)
{
Addscore as = new Addscore();
}
else if(e.getSource()==item3)
{
Updatescore as=new Updatescore();
}
else{
Genggai as=new Genggai();
}
}
4调试与测试
教师模块在调试的过程中总是出先数据无法正常的存入数据库的现象,解决起来都比较耗时,如何处理好界面之间的跳转,处理起来确实考验人的耐心和毅力,好在问题都能解决。
5.3 学生模块
功能设计
学生成绩管理系统在学生界面的功能设计主要考虑学生的基本信息查询,各科的成绩查询,修改学生的登录密码等。
界面设计
学生界面:
查询学生信息:
查询学生成绩:
3模块算法(或重要代码段)
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==Item1)//
{
Mima mima=new Mima();
}
else if(e.getSource()==Item2)
{
Serch ser = new Serch();
}
else{
Score so = new Score();
}
}
4调试与测试
主要的问题就是各个类之间的连接问题,如何在点击查询成绩按钮之后程序能自动跳转到查询成绩的界面类似这样的问题还是比较麻烦的。
小结和展望
这次数据库的课程设计其实是做的比之前好的很多,起码我是这么认为的。之前的课程设计仅仅是做了一下数据库,就是那种单纯的做数据库,没有前台,没有界面。这次的数据库是之前的一次很大的提升。做了界面,在界面上也花了很多的功夫。因为自己不擅长编程,所以编程对我来说也花了很多的时间。几乎是一边在学习一边在做设计。当然这样进行的过程就是进步也是挺大的。不仅要考虑数据库的设计,界面的设计,更重要的是还要把这两部分结合在一起,良好的结合在一起,并且能够运行,这是
最关键的地方。还好现在的网络发达,有不懂得地方就可以上网查询。实在有不懂得的地方还可以问老师,同学。他们都挺热衷于解答的。就这样,一点点的测试,一点的修改。
两个星期就这么的过去了,关于数据库的设计想了一些
方案
气瓶 现场处置方案 .pdf气瓶 现场处置方案 .doc见习基地管理方案.doc关于群访事件的化解方案建筑工地扬尘治理专项方案下载
,但是很快的就发现不适用。可能是因为没有做过项目的缘故吧,总是不能最好的顾及到用户的体验,无法很好的知道用户想实现的功能是什么。不过还好这次做的学生成绩管理系统并没有什么大的难度,一些功能都可以想的到。没有遗漏什么大的功能。
对于数据库的学习虽然已经结束了,但我想这还是不够的,这点理论知识显然不能应对社会上的挑战。我对数据库挺感兴趣的,我想在这一领域,真正的掌握知识,加油吧。
参 考 文 献
[1] 耿祥义, 张跃平. Java大学实用教程(第3版).电子工业出版社
[2]郑阿奇,刘启芬,顾韶华,sql server使用教程(第3版) 电子工业出版社
附 录
使用说明书
用户根据自己的身份选择登录,如果你是学生,输入学号和密码,即可登录学生界面。在学生界面你可以查询自己的基本信息,查询各科的成绩,以及修改密码。查询成绩和基本信息的时候不需要输入密码。如果你是老师,输入你的教师号和登录密码,即可以进入学生成绩管理系统。在教师界面,你可以录入学生的基本信息,录入学生的成绩,修改学生的基本信息,以及修改密码。
//登录界面
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
class Systems extends JFrame implements ActionListener
{
private static final Component Teacherwindow = null;
public static String user;
public static String pass;
static Systems ss;
//创建一个JPanel面板。JPanel是一个轻量级容易。
JPanel panel = new JPanel();
JLabel label1 = new JLabel("登录账号:");
JTextField name = new JTextField();
JLabel label2 = new JLabel("密 码:");
JPasswordField pwd = new JPasswordField();
JButton Enter = new JButton("登录");
JButton Exit = new JButton("退出");
//
String url = "E:\\mysql\\QQ图片20131223120608.jpg";
ButtonGroup bgp = new ButtonGroup();
//
An implementation of a radio button -- an item that can be
//
selected or deselected, and which displays its state to the user.
//
Used with a ButtonGroup object to create a group of buttons in which
//
only one button at a time can be selected.
//创建一个单选项。JRadioButton为单选按钮。
JRadioButton xsb = new JRadioButton("学生");
JRadioButton tch = new JRadioButton("教师");
//201107024111
public Systems()
{
//Creates a new, initially invisible Frame with the specified title.
super("登录系统");
this.setResizable(false);//设置窗口大小不可调整。
this.setBounds(40,60,800,800);
JLabel img = new JLabel(new ImageIcon(url));
img.setBounds(0,0,500,125);
panel.add(img);
xsb.setBounds(165,210,70,20);
tch.setBounds(265,210,70,20);
//bgp为单选按钮。
bgp.add(xsb);
bgp.add(tch);
//想panel中添加xsb和tch单选按钮。
panel.add(xsb);
panel.add(tch);
Enter.setBounds(150,250,80,20);
Exit.setBounds(270,250,80,20);
//Adds an ActionListener to the button.
//向enter和exit添加监视器。
Enter.addActionListener(this);
Exit.addActionListener(this);
//想panel中添加enter和exit单选按钮。
panel.add(Enter);
panel.add(Exit);
//
Sets the layout manager for this container.
panel.setLayout(null);
this.add(panel);
label1.setBounds(135,130,100,25);
panel.add(label1);
name.setBounds(265,130,100,25);
panel.add(name);
label2.setBounds(135,165,100,25);
panel.add(label2);
pwd.setBounds(265,165,100,25);
panel.add(pwd);
this.setBounds(400,100,500,350);
//设置可见
this.setVisible(true);
//隐藏当前窗口,并释放窗体咱有的其他资源。
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
//
actionPerformed :Invoked when an action occurs.
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==Enter)
{
String username , password;
username = name.getText();
password = new String(pwd.getPassword());
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
}
catch (ClassNotFoundException ce)
{//Brings up an information-message dialog titled "Message".
JOptionPane.showMessageDialog(ss,ce.getMessage());
}//一下程序判断是学生按钮被选中还是教师按钮被选中。
if(xsb.isSelected())
{
try
{
Connection con = DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=xscjgl","sjs","1234");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("exec student_info");
while(rs.next())
{
if(rs.getString("学号").equals(username))
if((rs.getString("密码").equals(password)))
{save.user=username;
save.userpassword=password;
JOptionPane.showMessageDialog(ss,rs.getString("姓名")+"同学!您好!欢迎登录教师管理系统!");
Students stu = new Students();
}
else
{
JOptionPane.showMessageDialog(ss,"登录失败");
}
}//处理完之后释放资源。
rs.close();
stmt.close();
}//传说中的抛出异常。。。
catch (SQLException se)
{
JOptionPane.showMessageDialog(ss,se.getMessage());
}
}
else if(tch.isSelected())
{
try
{
Connection con = DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=xscjgl","sjs","1234");
Statement stmt = con.createStatement();
String id = null;
ResultSet rs = stmt.executeQuery("select * from TCH");
while(rs.next())
{
if(rs.getString("教师号").equals(username))
if((rs.getString("密码").equals(password)))
{
JOptionPane.showMessageDialog(ss,rs.getString("姓名")+"老师!您好!欢迎登录教师管理系统!");
Teachers tch=new Teachers();//"登陆成功"
}
else
{
JOptionPane.showMessageDialog(ss, "登录失败");
}
}
}
catch (SQLException se)
{
JOptionPane.showMessageDialog(ss,se.getMessage());
}
}
}
else
{
System.exit(0);
}
}
}
public class System {
public static Object out;
public static void main(String[] args)
{
new Systems();
}
public static void exit(int i) {
}
}
class save {//声明变量
public static String user;
public static String userpassword;
public static String[] listGroupname;
}
//教师界面:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Teachers extends JFrame implements ActionListener
{ //创建一个菜单条。
JMenuBar bar = new JMenuBar();
//创建一个指定标题的菜单。标题分别为信息和成绩。
JMenu menu1 = new JMenu("信息");
JMenu menu2 = new JMenu("成绩");
JMenu menu3 = new JMenu("修改");
JMenu menu4 = new JMenu("更改");
//构造有标题的菜单项
JMenuItem item1 = new JMenuItem("录入信息");
JMenuItem item2 = new JMenuItem("录入成绩");
JMenuItem item3 = new JMenuItem("修改成绩");
JMenuItem item4 = new JMenuItem("更改密码");
//JPanel is a generic lightweight container.
JPanel jpl = new JPanel();
String url = "E:\\mysql\\20120106144252_xARit.jpg";
//创建标签。A display area for a short text string or an image, or both.
//
A label does not react to input events.
JLabel label0 = new JLabel("华北科技学院",JLabel.LEFT);
JLabel label1 = new JLabel("注意 : 请勿随意删除学生信息。",JLabel.LEFT);
JLabel label2 = new JLabel("注意 :请各位老师仔细输入学生信息。",JLabel.LEFT);
JLabel label3 = new JLabel("注意 :如有疑问请联系各单位教学秘书。",JLabel.LEFT);
//此处的teacher为构造方法,构造方法的名字必须和类名一致。
public Teachers()
{
super("教师界面");
this.setBounds(400,60,500,300);
this.setResizable(false);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
String usertch=save.user;
//Sets the menubar for this frame.设置菜单条。
this.setJMenuBar(bar);
this.add(jpl);
jpl.setLayout(null);
bar.add(menu1);
bar.add(menu2);
bar.add(menu3);
bar.add(menu4);
menu1.add(item1);
menu2.add(item2);
menu3.add(item3);
menu4.add(item4);
//添加监视器。this表示当前窗口。
item1.addActionListener(this);
item2.addActionListener(this);
item3.addActionListener(this);
item4.addActionListener(this);
//设置初始化位置。
label0.setBounds(378,180,600,20);
jpl.add(label0);
label1.setBounds(100,40,600,20);
jpl.add(label1);
label2.setBounds(100,60,700,20);
jpl.add(label2);
label3.setBounds(100,80,700,20);
jpl.add(label3);
JLabel img = new JLabel(new ImageIcon(url));
img.setBounds(0,0,500,300);
jpl.add(img);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==item1)
{
AddMsg msg = new AddMsg();
}
else if(e.getSource()==item2)
{
Addscore as = new Addscore();
}
else if(e.getSource()==item3)
{
Updatescore as=new Updatescore();
}
else{
Genggai as=new Genggai();
}
}
public static void main(String[] args)
{
Teachers tch = new Teachers();
}
}
//学生登录界面:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Students extends JFrame implements ActionListener
{
private static Object rs;
//
创建一个菜单条。
JMenuBar jmb = new JMenuBar();
JMenu mima = new JMenu("密码");
JMenu Message = new JMenu("信息");
JMenu Score = new JMenu("成绩");
//
构造有标题的菜单项。
JMenuItem Item1 = new JMenuItem("修改密码");
JMenuItem Item2 = new JMenuItem("查询信息");
JMenuItem Item3 = new JMenuItem("查询成绩");
//
构造面板
JPanel jpl = new JPanel();
String url = "E:\\mysql\\20120106144252_xARit.jpg";
//构造标签。
JLabel label1 = new JLabel("校训:自立立人,兴安安国",JLabel.LEFT);
JLabel label2 = new JLabel("North China Institute of Science and Technology",JLabel.LEFT);
JLabel label3 = new JLabel("如有疑问请联系个单位教学秘书。",JLabel.LEFT);
JLabel label4 = new JLabel("华北科技学院",JLabel.LEFT);
public Students()
{//
super("学生界面");
this.setBounds(400,60,500,300);
this.setVisible(true);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//
设置菜单条。
this.setJMenuBar(jmb);
jmb.add(mima);
jmb.add(Message);
jmb.add(Score);
mima.add(Item1);
Message.add(Item2);
Score.add(Item3);
//
添加监视器.
Item1.addActionListener(this);
Item2.addActionListener(this);
Item3.addActionListener(this);
this.add(jpl);
//
Sets the layout manager for this container.
jpl.setLayout(null);
label1.setBounds(100,40,600,20);
jpl.add(label1);
label2.setBounds(100,60,700,20);
jpl.add(label2);
label3.setBounds(100,80,600,20);
jpl.add(label3);
label4.setBounds(378,180,600,20);
jpl.add(label4);
JLabel img = new JLabel(new ImageIcon(url));
img.setBounds(0,0,500,300);
jpl.add(img);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==Item1)//
{
Mima mima=new Mima();
}
else if(e.getSource()==Item2)
{
Serch ser = new Serch();
}
else{
Score so = new Score();
}
}
public static void main(String[] args)
{
Students stu = new Students();
}
}
//学生成绩添加:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
public class Addscore extends JFrame implements ActionListener
{
static Addscore ss;
JLabel[] label = {new JLabel("学号:") , new JLabel("计算机基础:") , new JLabel("程序设计与语言:") , new JLabel("离散数学:") , new JLabel("计算机原理:") , new JLabel("操作系统:") , new JLabel("数据库原理:") , new JLabel("高等数学:") , new JLabel("计算机网络:")};
JTextField[] txt = {new JTextField() , new JTextField() , new JTextField() , new JTextField() , new JTextField() ,new JTextField() , new JTextField() ,new JTextField() ,new JTextField() };
JButton add = new JButton("添加");
JButton reset = new JButton("重置");
JPanel jpl = new JPanel();
JLabel title = new JLabel("添加学生成绩" , JLabel.CENTER);
Font f = new Font("宋体" , Font.BOLD , 22 );
int s = 100;
String url = "E:\\mysql\\79f0f736afc37931f5864ad2eac4b74542a9115b.jpg";
JLabel label0 = new JLabel("华北科技学院",JLabel.LEFT);
public Addscore()
{//
super("学生成绩管理系统:添加学生成绩");
this.setResizable(true);
this.setBounds(400,70,500,600); //setSize(500,600);只设置宽和高,默认距离屏幕左面和屏幕上方为0个像素。
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
this.setVisible(true);
this.add(jpl);
add.addActionListener(this);
reset.addActionListener(this);
//Sets the layout manager for this container.
jpl.setLayout(null);
title.setBounds(150,40,200,20);
title.setFont(f);
title.setForeground(Color.BLACK);
//jpl.setBackground(Color.LIGHT_GRAY);
jpl.add(title);
JLabel img = new JLabel(new ImageIcon(url));
img.setBounds(0,0,500,565);
for(int i = 0 ; i
本文档为【学生成绩管理系统课程设计】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。