




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
学生选课系统(数据库课程设计)JAVA,SQLserver数据库课程设计学生选课系统
importjava.sql.*;
importjavax.swing.*;
importjavax.swing.table.AbstractTableModel;
importjava.awt.*;
importjava.awt.event.*;
publicclassDLAextendsJFrameimplementsActionListener{
JPanelp;
ImageIconi;
Choicec;
JLabell1,l2,l3,l;
JTextFieldt1,t2;
JButtonb1,b2;
publicDLA(Stringstr){
super(str);
p=newJPanel();
i=newImageIcon(“psue.jpg");
l=newJLabel(i);
l.setBounds(0,0,i.getIconWidth(),i.getIconHeight());
getLayeredPane().add(l,newInteger(Integer.MIN_VALUE));
p=(JPanel)this.getContentPane();
p.setOpaque(false);
p.setLayout(newFlowLayout(FlowLayout.CENTER,110,30));
c=newChoice();
c.add("管理员");
c.add("教师");
c.add("学生");
l1=newJLabel("登陆身份");
l2=newJLabel("用户账号");
l3=newJLabel("用户密码");
t1=newJTextField("",10);
t2=newJTextField("",10);
b1=newJButton("确定");
b2=newJButton("退出");
b1.addActionListener(this);
b2.addActionListener(this);
p.add(l1);
p.add(c);
p.add(l2);
p.add(t1);
p.add(l3);
p.add(t2);
p.add(b1);
p.add(b2);
}
publicvoidactionPerformed(ActionEvente){
if(e.getSource()==b1){
if((t1.getText().equals("")||t2.getText().equals(""))||
((!c.getSelectedItem().equals("管理员")||!t1.getText().equals("SQS")||!t2.getText().equals("20XX年28"))
(!c.getSelectedItem().equals("教师")||!t1.getText().equals("JS")||!t2.getText().equals("*****"))
(!c.getSelectedItem().equals("学生")||!t1.getText().equals("XS")||!t2.getText().equals("*****"))))
{t1.setText("");t2.setText("");
JOptionPane.showMessageDialog(this,"账号或密码不能为空或错误!","提示",JOptionPane.*****_*****);}
if(c.getSelectedItem().equals("管理员")t1.getText().equals("SQS")t2.getText().equals("20XX年28")){
this.dispose();
GLYgly=newGLY("管理员界面");
gly.setLocation(400,200);
gly.setSize(500,300);
gly.setVisible(true);
}
if(c.getSelectedItem().equals("教师")t1.getText().equals("JS")t2.getText().equals("*****")){
this.dispose();
JSjs=newJS("教师界面");
js.setLocation(400,200);
js.setSize(500,300);
js.setVisible(true);
}
if(c.getSelectedItem().equals("学生")t1.getText().equals("XS")t2.getText().equals("*****")){
this.dispose();
XSxs=newXS("学生界面");
xs.setLocati
on(400,200);
xs.setSize(500,300);
xs.setVisible(true);
}
}
if(e.getSource()==b2){
System.exit(0);
}
}
publicstaticvoidmain(String[
JAVA,SQLserver数据库课程设计学生选课系统
]args){
DLAdl=newDLA("登陆学生选课系统");
dl.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
dl.setLocation(400,200);
dl.setSize(500,300);
dl.setVisible(true);
}
}
classGLYextendsJFrameimplementsActionListener{
JPanelp;
ImageIconi;
JLabell;
JButtonb1,b2,b3,b4;
publicGLY(Stringstr){
super(str);
p=newJPanel();
i=newImageIcon("http_imgload.jpg");
l=newJLabel(i);
l.setBounds(0,0,i.getIconWidth(),i.getIconHeight());
getLayeredPane().add(l,newInteger(Integer.MIN_VALUE));
p=(JPanel)this.getContentPane();
p.setOpaque(false);
p.setLayout(newFlowLayout(FlowLayout.CENTER,110,70));
b1=newJButton("管理教师");
b2=newJButton("管理学生");
b3=newJButton("管理课程");
b4=newJButton("返回上级");
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
}
publicvoidactionPerformed(ActionEvente){
if(e.getSource()==b1){
this.dispose();
GLJSgly=newGLJS("管理教师界面");
gly.setLocation(400,200);
gly.setSize(500,300);
gly.setVisible(true);
}
if(e.getSource()==b2){
this.dispose();
GLXSjs=newGLXS("管理学生界面");
js.setLocation(400,200);
js.setSize(500,300);
js.setVisible(true);
}
if(e.getSource()==b3){
this.dispose();
GLKCxs=newGLKC("管理课程界面");
xs.setLocation(400,200);
xs.setSize(500,300);
xs.setVisible(true);
}
if(e.getSource()==b4){
this.dispose();
DLAdl=newDLA("登陆学生选课系统");
dl.setLocation(400,200);
dl.setSize(500,300);
dl.setVisible(true);
}
}
}
classJSextendsJFrameimplementsActionListener{
JPanelp;
JButtonb1,b2,b3;
ImageIconi;
JLabell;
publicJS(Stringstr){
super(str);
p=newJPanel();
i=newImageIcon("*****B19-1.jpg");
l=newJLabel(i);
l.setBounds(0,0,i.getIconWidth(),i.getIconHeight());
getLayeredPane().add(l,newInteger(Integer.MIN_VALUE));
p=(JPanel)this.getContentPane();
p.setOpaque(false);
p.setLayout(newFlowLayout(FlowLayout.CENTER,110,70));
b1=newJButton("个人代课界面");
b2=newJButton("查询自己信息");
b3=newJButton("返回上级");
p.add(b1);
p.add(b2);
p.add(b3);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
}
publicvoidactionPerfo
rmed(ActionEvente){
if(e.getSource()==b1){
this.dispose();
JSDKgly=newJSDK("个人代课界面界面");
gly.setLocation(400,200);
gly.setSize
JAVA,SQLserver数据库课程设计学生选课系统
(500,300);
gly.setVisible(true);
}
if(e.getSource()==b2){
this.dispose();
DLJSXXjs=newDLJSXX("查询自己信息界面");
js.setLocation(400,200);
js.setSize(500,300);
js.setVisible(true);
}
if(e.getSource()==b3){
this.dispose();
DLAdl=newDLA("登陆学生选课系统");
dl.setLocation(400,200);
dl.setSize(500,300);
dl.setVisible(true);
}
}
}
classXSextendsJFrameimplementsActionListener{
JPanelp;
ImageIconi;
JLabell;
JButtonb1,b2,b3;
publicXS(Stringstr){
super(str);
p=newJPanel();
i=newImageIcon("psbe.jpg");
l=newJLabel(i);
l.setBounds(0,0,i.getIconWidth(),i.getIconHeight());
getLayeredPane().add(l,newInteger(Integer.MIN_VALUE));
p=(JPanel)this.getContentPane();
p.setOpaque(false);
p.setLayout(newFlowLayout(FlowLayout.CENTER,110,70));
b1=newJButton("个人选课界面");
b2=newJButton("查询自己信息");
b3=newJButton("返回上级");
p.add(b1);
p.add(b2);
p.add(b3);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
}
publicvoidactionPerformed(ActionEvente){
if(e.getSource()==b1){
this.dispose();
XSXKgly=newXSXK("个人选课界面");
gly.setLocation(400,200);
gly.setSize(500,300);
gly.setVisible(true);
}
if(e.getSource()==b2){
this.dispose();
DLXSXXjs=newDLXSXX("查询自己信息");
js.setLocation(400,200);
js.setSize(500,300);
js.setVisible(true);
}
if(e.getSource()==b3){
this.dispose();
DLAdl=newDLA("登陆学生选课系统");
dl.setLocation(400,200);
dl.setSize(500,300);
dl.setVisible(true);
}
}
}
classGLJSextendsJFrameimplementsActionListener{
JPanelp;
ImageIconi;
JLabell;
JButtonb1,b2,b3,b4;
publicGLJS(Stringstr){
super(str);
JPanelp=newJPanel();
i=newImageIcon("qingchun09.jpg");
l=newJLabel(i);
l.setBounds(0,0,i.getIconWidth(),i.getIconHeight());
getLayeredPane().add(l,newInteger(Integer.MIN_VALUE));
p=(JPanel)this.getContentPane();
p.setOpaque(false);
p.setLayout(newFlowLayout(FlowLayout.CENTER,110,70));
b1=newJButton("添加教师");
b2=newJButton("删除教师");
b3=newJButton("查询教师");
b4=newJButton("返回上级");
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
b1.addActionListener(this);
b2.addActionListener(this);
b3.a
ddActionListener(this);
b4.addActionListener(this);
}
publicvoidactionPerformed(ActionEvente){
if(e.getSource()==b1){
this.dispose();
T
JAVA,SQLserver数据库课程设计学生选课系统
JJSgly=newTJJS("添加教师界面");
gly.setLocation(400,200);
gly.setSize(500,300);
gly.setVisible(true);
}
if(e.getSource()==b2){
this.dispose();
SCJSjs=newSCJS("删除教师界面");
js.setLocation(400,200);
js.setSize(500,300);
js.setVisible(true);
}
if(e.getSource()==b3){
this.dispose();
CXJSxs=newCXJS("查询教师界面");
xs.setLocation(400,200);
xs.setSize(500,300);
xs.setVisible(true);
}
if(e.getSource()==b4){
this.dispose();
GLYgly=newGLY("管理员界面");
gly.setLocation(400,200);
gly.setSize(500,300);
gly.setVisible(true);
}
}
}
classGLXSextendsJFrameimplementsActionListener{
JPanelp;
ImageIconi;
JLabell;
JButtonb1,b2,b3,b4;
publicGLXS(Stringstr){
super(str);
p=newJPanel();
i=newImageIcon("截图***-*****83.jpg");
l=newJLabel(i);
l.setBounds(0,0,i.getIconWidth(),i.getIconHeight());
getLayeredPane().add(l,newInteger(Integer.MIN_VALUE));
p=(JPanel)this.getContentPane();
p.setOpaque(false);
p.setLayout(newFlowLayout(FlowLayout.CENTER,110,70));
b1=newJButton("添加学生");
b2=newJButton("删除学生");
b3=newJButton("查询学生");
b4=newJButton("返回上级");
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
}
publicvoidactionPerformed(ActionEvente){
if(e.getSource()==b1){
this.dispose();
TJXSgly=newTJXS("添加学生界面");
gly.setLocation(400,200);
gly.setSize(500,300);
gly.setVisible(true);
}
if(e.getSource()==b2){
this.dispose();
SCXSjs=newSCXS("删除学生界面");
js.setLocation(400,200);
js.setSize(500,300);
js.setVisible(true);
}
if(e.getSource()==b3){
this.dispose();
CXXSxs=newCXXS("查询学生界面");
xs.setLocation(400,200);
xs.setSize(500,300);
xs.setVisible(true);
}
if(e.getSource()==b4){
this.dispose();
GLYgly=newGLY("管理员界面");
gly.setLocation(400,200);
gly.setSize(500,300);
gly.setVisible(true);
}
}
}
classGLKCextendsJFrameimplementsActionListener{
JPanelp;
ImageIconi;
JLabell;
JButtonb1,b2,b3,b4;
publicGLKC(Stringstr){
super(str);
p=newJPanel();
i=newImageIcon("70b90e
f82ea9c0dc58ee905c.jpg");
l=newJLabel(i);
l.setBounds(0,0,i.getIconWidth(),i.getIconHeight());
getLayeredPane().add(l,newInteger(
JAVA,SQLserver数据库课程设计学生选课系统
Integer.MIN_VALUE));
p=(JPanel)this.getContentPane();
p.setOpaque(false);
p.setLayout(newFlowLayout(FlowLayout.CENTER,110,70));
b1=newJButton("添加课程");
b2=newJButton("删除课程");
b3=newJButton("查询课程");
b4=newJButton("返回上级");
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
}
publicvoidactionPerformed(ActionEvente){
if(e.getSource()==b1){
this.dispose();
TJKCgly=newTJKC("添加课程界面");
gly.setLocation(400,200);
gly.setSize(500,300);
gly.setVisible(true);
}
if(e.getSource()==b2){
this.dispose();
SCKCjs=newSCKC("删除课程界面");
js.setLocation(400,200);
js.setSize(500,300);
js.setVisible(true);
}
if(e.getSource()==b3){
this.dispose();
CXKCxs=newCXKC("查询课程界面");
xs.setLocation(400,200);
xs.setSize(500,300);
xs.setVisible(true);
}
if(e.getSource()==b4){
this.dispose();
GLYgly=newGLY("管理员界面");
gly.setLocation(400,200);
gly.setSize(500,300);
gly.setVisible(true);
}
}
}
classTJJSextendsJFrameimplementsActionListener{
JPanelp;
ImageIconi;
JLabell1,l2,l3,l4,l5,l
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 酒精厂上岗考试试题及答案
- 大专专业化学考试试题及答案
- 技师考试试题及答案
- 畅想未来主题班会
- 2024-2025学年河北省石家庄市赵县七年级(下)期中地理试卷
- 昆山护士考试试题及答案
- 哲学博士考试试题及答案
- 儿童痢疾的防治与治疗
- 河北省保定市部分高中2023-2024学年高三上学期1月期末考地理含解析
- 哮喘发作患儿治疗方案
- 量子图像处理
- 金属热处理工(中级工)职业技能认定考试题库(含答案)
- 政府采购代理服务方案
- (完整版)英语四级词汇表
- 消防控制室值班记录(制式表格)63052
- 技工学校国家助学金申请表
- 中国法兰锻件行业市场需求研究及前景趋势分析报告2024-2030年
- 重型燃气轮机用大型铸锻件 第3部分:铸钢件 编制说明
- 幼师毕业证明书样本
- 重大事故隐患判定标准培训记录、培训效果评估
- 环卫车辆采购投标方案(技术方案)
评论
0/150
提交评论