資源簡介
java+ mysql 學生 成績 管理 系統 完整版

代碼片段和文件信息
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
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-07-20?09:19??成績管理系統\
?????文件?????????391??2011-08-17?16:23??成績管理系統\.classpath
?????文件?????????382??2011-08-17?10:49??成績管理系統\.project
?????目錄???????????0??2012-07-20?09:19??成績管理系統\.settings\
?????文件?????????629??2011-08-17?10:49??成績管理系統\.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2012-07-20?09:19??成績管理系統\bin\
?????目錄???????????0??2012-07-20?09:19??成績管理系統\bin\wyf\
?????目錄???????????0??2012-07-20?09:19??成績管理系統\bin\wyf\cgq\
?????文件????????4886??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\ChangePwd.class
?????文件????????5597??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\ChangePwdTeacher.class
?????文件????????7317??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\ChoseCourse.class
?????文件???????12258??2011-08-22?16:16??成績管理系統\bin\wyf\cgq\CourseManage.class
?????文件????????1121??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\CourseTable$TableViewRenderer.class
?????文件????????4699??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\CourseTable.class
?????文件????????4132??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\GetScore.class
?????文件????????3242??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\GetStuInfo.class
?????文件????????3157??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\GradeInDB$TableChangeListener.class
?????文件????????7604??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\GradeInDB.class
?????文件????????7335??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\Login.class
?????文件????????6173??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\NewClass.class
?????文件????????6984??2011-08-22?16:17??成績管理系統\bin\wyf\cgq\NewCourse.class
?????文件???????11911??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\NewStu.class
?????文件????????2474??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\StuClient$1.class
?????文件?????????737??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\StuClient$MyNode.class
?????文件????????5878??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\StuClient.class
?????文件????????1688??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\StuFailGrade.class
?????文件????????2180??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\StuGrade.class
?????文件????????2624??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\StuInfo.class
?????文件????????3802??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\StuScore.class
?????文件????????3082??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\TeacherClient$1.class
?????文件?????????761??2011-08-22?16:03??成績管理系統\bin\wyf\cgq\TeacherClient$MyNode.class
............此處省略65個文件信息
評論
共有 條評論