• 大小: 1.01MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-23
  • 语言: Java
  • 标签:

资源简介

学生管理系统的代码,带注释的哦 教师端功能 可以更改密码。 可以添加学生,并要求填写学生的基本信息。 可以根据学号查询学生基本信息及其成绩。 有权限控制,每个管理员只能管理其所在学院的信息。 可以控制选课的课程范围,并可以控制选课的时间,即可以控制选课的开始与结束。 可以录入成绩,缓存成绩,检查无误后公布成绩 学生端功能 学生可以查看自己的基本信息。 学生可以查看自己的成绩,已修学分和不及格成绩信息 学生端可以进行远程选课,并且可以查看课表。

资源截图

代码片段和文件信息

package wyf.cgq;
import java.sql.*;
import java.awt.event.*;
import javax.swing.*;
public class ChangePwd extends JPanel implements ActionListener
{

/**
 * pluto
 */
private static final long serialVersionUID = 1L;
private String host; 
  //声明Connection引用、Statement对象引用与结果集引用
private Connection conn;
private Statement stmt;
private ResultSet rs;
//声明用与表示当前学生学号的引用
private String stu_id;
//创建信息提示标签数组
private JLabel[] jlArray={new JLabel(“原始密码“)new JLabel(“新密码“)new JLabel(“确认新密码“)
                         };
//创建密码框数组
private JPasswordField[] jpfArray={new JPasswordField()new JPasswordField()new JPasswordField()
                             };
//创建操作按钮数组
private JButton[] jbArray={new JButton(“确认“)new JButton(“重置“)
                          };
//构造器
public ChangePwd(String stu_idString host)
{
this.host=host;
this.stu_id=stu_id;
//初始化页面
this.initialframe();
//注册监听器
this.addListener();
}
//集体注册监听器的方法
public void addListener()
{
jpfArray[0].addActionListener(this);
jpfArray[1].addActionListener(this);
jpfArray[2].addActionListener(this);
jbArray[0].addActionListener(this);
jbArray[1].addActionListener(this);
}
//初始化页面的方法
public void initialframe()
{
this.setLayout(null);
for(int i=0;i {
jlArray[i].setBounds(3020+50*i15030);
this.add(jlArray[i]);
jpfArray[i].setBounds(13020+50*i15030);
this.add(jpfArray[i]);
}
jbArray[0].setBounds(4018010030);
this.add(jbArray[0]);
jbArray[1].setBounds(17018010030);
this.add(jbArray[1]);
}
//实现ActionListener接口中的方法
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==jpfArray[0])
{
jpfArray[1].requestFocus(true);
}
else if(e.getSource()==jpfArray[1])
{
jpfArray[2].requestFocus(true);
}
else if(e.getSource()==jpfArray[2])
{
jbArray[0].requestFocus(true);
}
else if(e.getSource()==jbArray[1])
{//按下重置按钮的处理代码
    //将输入信息清空
for(int i=0;i {
jpfArray[i].setText(““);
}
}
else if(e.getSource()==jbArray[0])
{//按下确认按钮的处理代码
    //用于判断密码格式的正则式字符串
String patternStr=“[0-9a-zA-Z]{612}“;
//获取用户输入的旧密码
@SuppressWarnings(“deprecation“)
String oldPwd=jpfArray[0].getText();
if(oldPwd.equals(““))
{//旧密码空
JOptionPane.showMessageDialog(this“请输入原始密码““错误“JOptionPane.ERROR_MESSAGE);
return;
}
//获取新密码

//pluto
@SuppressWarnings(“deprecation“)
String newPwd=jpfArray[1].getText();
if(newPwd.equals(““))
{//新密码为空
JOptionPane.showMessageDialog(this“请输入新密码““错误“JOptionPane.ERROR_MESSAGE);
return;
}
if(!newPwd.matches(patternStr))
{//新密码格式不正确
JOptionPane.showMessageDialog(this“密码只能是6到12位的字母或数字““错误“JOptionPane.ERROR_MESSAGE);
return;
}
//获取确认密码

//pluto
@SuppressWarnings(“deprecation“)
String newPwd1=jpfArray[2].getText();
if(!newPwd.e

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        391  2011-08-17 16:23  ch02\.classpath

     文件        382  2011-08-17 10:49  ch02\.project

     文件        629  2011-08-17 10:49  ch02\.settings\org.eclipse.jdt.core.prefs

     文件       4886  2011-08-22 16:03  ch02\bin\wyf\cgq\ChangePwd.class

     文件       5597  2011-08-22 16:03  ch02\bin\wyf\cgq\ChangePwdTeacher.class

     文件       7317  2011-08-22 16:03  ch02\bin\wyf\cgq\ChoseCourse.class

     文件      12258  2011-08-22 16:16  ch02\bin\wyf\cgq\CourseManage.class

     文件       1121  2011-08-22 16:03  ch02\bin\wyf\cgq\CourseTable$TableViewRenderer.class

     文件       4699  2011-08-22 16:03  ch02\bin\wyf\cgq\CourseTable.class

     文件       4132  2011-08-22 16:03  ch02\bin\wyf\cgq\GetScore.class

     文件       3242  2011-08-22 16:03  ch02\bin\wyf\cgq\GetStuInfo.class

     文件       3157  2011-08-22 16:03  ch02\bin\wyf\cgq\GradeInDB$TableChangeListener.class

     文件       7604  2011-08-22 16:03  ch02\bin\wyf\cgq\GradeInDB.class

     文件       7335  2011-08-22 16:03  ch02\bin\wyf\cgq\Login.class

     文件       6173  2011-08-22 16:03  ch02\bin\wyf\cgq\NewClass.class

     文件       6984  2011-08-22 16:17  ch02\bin\wyf\cgq\NewCourse.class

     文件      11911  2011-08-22 16:03  ch02\bin\wyf\cgq\NewStu.class

     文件       2474  2011-08-22 16:03  ch02\bin\wyf\cgq\StuClient$1.class

     文件        737  2011-08-22 16:03  ch02\bin\wyf\cgq\StuClient$MyNode.class

     文件       5878  2011-08-22 16:03  ch02\bin\wyf\cgq\StuClient.class

     文件       1688  2011-08-22 16:03  ch02\bin\wyf\cgq\StuFailGrade.class

     文件       2180  2011-08-22 16:03  ch02\bin\wyf\cgq\StuGrade.class

     文件       2624  2011-08-22 16:03  ch02\bin\wyf\cgq\StuInfo.class

     文件       3802  2011-08-22 16:03  ch02\bin\wyf\cgq\StuScore.class

     文件       3082  2011-08-22 16:03  ch02\bin\wyf\cgq\TeacherClient$1.class

     文件        761  2011-08-22 16:03  ch02\bin\wyf\cgq\TeacherClient$MyNode.class

     文件       7021  2011-08-22 16:03  ch02\bin\wyf\cgq\TeacherClient.class

     文件       4363  2011-08-22 16:03  ch02\bin\wyf\cgq\TeachSearchInfo.class

     文件        763  2011-08-22 16:03  ch02\bin\wyf\cgq\Welcome.class

     文件       1045  2008-07-18 10:30  ch02\build\ico.gif

............此处省略69个文件信息

评论

共有 条评论