012221宋君易实验设计五教务处管理系统文档格式.docx
- 文档编号:21164338
- 上传时间:2023-01-28
- 格式:DOCX
- 页数:48
- 大小:1.04MB
012221宋君易实验设计五教务处管理系统文档格式.docx
《012221宋君易实验设计五教务处管理系统文档格式.docx》由会员分享,可在线阅读,更多相关《012221宋君易实验设计五教务处管理系统文档格式.docx(48页珍藏版)》请在冰豆网上搜索。
(2)主要软件:
①操作系统可为Windows9X、WinMe、Win2000或更高版本等;
②开发环境为jdk或者jcreator。
(3)参考书目:
①尹继平,张帆.java范例大全.机械工业出版社
②施霞萍.java程序设计教程.机械工业出版社
5.实验方法与步骤:
程序截图:
登陆界面
可以显示当前时间
输入用户名密码
每个账号都有自己的权限,不能进入非授权表
登陆学生档案管理系统
可查询信息
可添加新行,通过回车就可保存数据
登陆教师档案管理系统
可删除信息
退出系统
程序流程图
6.实验总结:
通过这次课程设计我掌握了Java与数据库的连接,并且实现了通过Java进行新建、查询、删除、修改操作,并通过制作界面,对Java界面的设计也有了更深的理解,在课设中虽然遇到了许多问题与困难,但是通过自己的研究与同学的帮助,最终成功完成了课设,积累了很多设计经验,为以后的学习打下了良好的基础。
附录:
登陆界面源代码:
/*
*Tochangethistemplate,chooseTools|Templates
*andopenthetemplateintheeditor.
*/
packageSQL;
importjava.awt.Component;
importjava.text.ParsePosition;
importjava.text.SimpleDateFormat;
importjava.util.Calendar;
importjava.util.Date;
importjavax.swing.JFrame;
importjavax.swing.JOptionPane;
importjava.sql.*;
importjava.util.*;
importjava.util.logging.*;
importjavax.swing.*;
importjavax.swing.event.*;
importjavax.swing.table.*;
classVeDate{
/**
*根据一个日期,返回是星期几的字符串
*
*@paramsdate
*@return
publicstaticStringgetStringDate(){
DatecurrentTime=newDate();
SimpleDateFormatformatter=newSimpleDateFormat("
yyyy-MM-ddHH:
mm:
ss"
);
StringdateString=formatter.format(currentTime);
returndateString;
}
publicstaticDatestrToDate(StringstrDate){
yyyy-MM-dd"
ParsePositionpos=newParsePosition(0);
Datestrtodate=formatter.parse(strDate,pos);
returnstrtodate;
publicstaticStringgetWeek(Stringsdate,Stringnum){
//再转换为时间
Datedd=VeDate.strToDate(sdate);
Calendarc=Calendar.getInstance();
c.setTime(dd);
if(num.equals("
1"
))//返回星期一所在的日期
{
c.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
}elseif(num.equals("
2"
))//返回星期二所在的日期
c.set(Calendar.DAY_OF_WEEK,Calendar.TUESDAY);
3"
))//返回星期三所在的日期
c.set(Calendar.DAY_OF_WEEK,Calendar.WEDNESDAY);
4"
))//返回星期四所在的日期
c.set(Calendar.DAY_OF_WEEK,Calendar.THURSDAY);
5"
))//返回星期五所在的日期
c.set(Calendar.DAY_OF_WEEK,Calendar.FRIDAY);
6"
))//返回星期六所在的日期
c.set(Calendar.DAY_OF_WEEK,Calendar.SATURDAY);
0"
))//返回星期日所在的日期
c.set(Calendar.DAY_OF_WEEK,Calendar.SUNDAY);
returnnewSimpleDateFormat("
).format(c.getTime());
publicstaticStringgetWeek(Stringsdate){
Datedate=VeDate.strToDate(sdate);
c.setTime(date);
//inthour=c.get(Calendar.DAY_OF_WEEK);
//hour中存的就是星期几了,其范围1~7
//1=星期日7=星期六,其他类推
EEEE"
publicstaticStringgetWeekStr(Stringsdate){
Stringstr="
"
;
str=VeDate.getWeek(sdate);
if("
.equals(str)){
str="
星期日"
}elseif("
星期一"
星期二"
星期三"
星期四"
星期五"
7"
星期六"
returnstr;
}//*/
publicclassloginextendsjavax.swing.JFrame{
*Createsnewformlogin
StringconnectionUrl="
jdbc:
sqlserver:
//localhost:
2159;
databaseName=学生教师档案;
user=sa;
password=otakulee123;
publiclogin(){
initComponents();
jLabel5.setText(VeDate.getStringDate());
jLabel6.setText(VeDate.getWeekStr(VeDate.getStringDate()));
try{
//获取驱动,这里使用的是sqljdbc_1.2.2828.100_chs.exe,不同版本的驱动,语句有所不同
Class.forName("
com.microsoft.sqlserver.jdbc.SQLServerDriver"
}catch(ClassNotFoundExceptionex){
Logger.getLogger(StudentSQL.class.getName()).log(Level.SEVERE,null,ex);
ImageIconimg=newImageIcon("
C:
\\DocumentsandSettings\\Administrator\\桌面\\桌面君\\红色桌面君\\素材\\sc120115_11a.jpg"
JLabelbacklabel=newJLabel(img);
getLayeredPane().add(backlabel,newInteger(Integer.MIN_VALUE));
backlabel.setBounds(0,0,580,352);
((JPanel)this.getContentPane()).setOpaque(false);
//设置为透明(opaque的意思为不透明)
this.setLocationRelativeTo(null);
*Thismethodiscalledfromwithintheconstructortoinitializetheform.
*WARNING:
DoNOTmodifythiscode.Thecontentofthismethodisalways
*regeneratedbytheFormEditor.
@SuppressWarnings("
unchecked"
)
//<
editor-folddefaultstate="
collapsed"
desc="
GeneratedCode"
>
privatevoidinitComponents(){
jButton1=newjavax.swing.JButton();
jTextField1=newjavax.swing.JTextField();
jLabel1=newjavax.swing.JLabel();
jLabel2=newjavax.swing.JLabel();
jLabel3=newjavax.swing.JLabel();
jButton2=newjavax.swing.JButton();
jComboBox1=newjavax.swing.JComboBox();
jLabel4=newjavax.swing.JLabel();
jLabel5=newjavax.swing.JLabel();
jLabel6=newjavax.swing.JLabel();
jPasswordField1=newjavax.swing.JPasswordField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setResizable(false);
jButton1.setText("
登陆"
jButton1.addActionListener(newjava.awt.event.ActionListener(){
publicvoidactionPerformed(java.awt.event.ActionEventevt){
jButton1ActionPerformed(evt);
});
jTextField1.addActionListener(newjava.awt.event.ActionListener(){
jTextField1ActionPerformed(evt);
jLabel1.setText("
用户名:
jLabel2.setText("
密码:
jLabel3.setFont(newjava.awt.Font("
微软雅黑"
1,24));
//NOI18N
jLabel3.setText("
教务处管理系统登陆界面"
jButton2.setText("
退出"
jButton2.addActionListener(newjava.awt.event.ActionListener(){
jButton2ActionPerformed(evt);
jComboBox1.setModel(newjavax.swing.DefaultComboBoxModel(newString[]{"
学生档案管理系统"
"
教师档案管理系统"
}));
jComboBox1.addActionListener(newjava.awt.event.ActionListener(){
jComboBox1ActionPerformed(evt);
jLabel4.setText("
选择登陆:
jLabel5.setText("
11111"
jLabel6.setText("
javax.swing.GroupLayoutlayout=newjavax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5)
.addComponent(jLabel6))
.addGap(0,0,Short.MAX_VALUE))
.addGap(165,165,165)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel4)
.addComponent(jLabel2,javax.swing.GroupLayout.PREFERRED_SIZE,36,javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18,18,18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,false)
.addComponent(jComboBox1,0,144,Short.MAX_VALUE)
.addComponent(jPasswordField1))
.addContainerGap())
.addGap(157,157,157)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,layout.createSequentialGroup()
.addComponent(jButton1)
.addGap(30,30,30)
.addComponent(jButton2)
.addGap(199,199,199))
.addComponent(jLabel3,javax.swing.GroupLayout.PREFERRED_SIZE,298,javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(115,115,115))
.addComponent(jLabel1)
.addComponent(jTextField1,javax.swing.GroupLayout.PREFERRED_SIZE,145,javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(182,182,182))))))
);
layout.setVerticalGroup(
.addComponent(jLabel3,javax.swing.GroupLayout.DEFAULT_SIZE,91,Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField1,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addComponent(jLabel2)
.addComponent(jPasswordField1,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jComboBox1,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGap(34,34,34)
.addComponent(jButton2))
.addComponent(jLabel6)
pack();
}//<
/editor-fold>
privatevoidjButton1Act
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 012221 宋君易 实验设计 教务处 管理 系统
![提示](https://static.bdocx.com/images/bang_tan.gif)