diff --git a/JavaProgrem.iml b/JavaProgrem.iml
index 77e9c970a69cb9b8d3f23d41041c330790b77a66..5553458b323440e6ab2ccc7aebcc724d13517f10 100644
--- a/JavaProgrem.iml
+++ b/JavaProgrem.iml
@@ -7,6 +7,15 @@
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/fxml/Personal.fxml b/src/fxml/Personal.fxml
index 1f6819831be40d5008d8807f3325097c9ce80670..86da0edb96eb8a63750c5250c925a7c49a1e3c4f 100644
--- a/src/fxml/Personal.fxml
+++ b/src/fxml/Personal.fxml
@@ -1,5 +1,6 @@
+
@@ -7,121 +8,56 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/imgzip/LoginSignIn/ChangePasswordSuccessfullyController.java b/src/imgzip/LoginSignIn/ChangePasswordSuccessfullyController.java
index 929ab8e0b5d408a7cdfc1e7688301e0e0f416de0..0d177f04cb0d74d8a422fc7b29e86516dc7ecf06 100644
--- a/src/imgzip/LoginSignIn/ChangePasswordSuccessfullyController.java
+++ b/src/imgzip/LoginSignIn/ChangePasswordSuccessfullyController.java
@@ -19,7 +19,7 @@ public class ChangePasswordSuccessfullyController {
*/
public void backToLogin(){
Stage stage = (Stage) SignUp.getScene().getWindow();
- new Loginbeginner();
+ new LoginBeginner();
stage.close();
}
diff --git a/src/imgzip/LoginSignIn/CreateAccountController.java b/src/imgzip/LoginSignIn/CreateAccountController.java
index b18aef06df0eae362db1015d326f79575f351e12..889abaaec03b5f69d51af20bb059b023d9ff96c5 100644
--- a/src/imgzip/LoginSignIn/CreateAccountController.java
+++ b/src/imgzip/LoginSignIn/CreateAccountController.java
@@ -55,7 +55,7 @@ public class CreateAccountController {
*/
public void backToLogin() {
Stage stage = (Stage) signIn.getScene().getWindow();
- new Loginbeginner();
+ new LoginBeginner();
stage.close();
}
diff --git a/src/imgzip/LoginSignIn/CreateSuccessfullyController.java b/src/imgzip/LoginSignIn/CreateSuccessfullyController.java
index 8478e02487db4b2e026352d4e4682df0ddc49328..29e2efb00ff8216a3f9a827343090e59350a1de7 100644
--- a/src/imgzip/LoginSignIn/CreateSuccessfullyController.java
+++ b/src/imgzip/LoginSignIn/CreateSuccessfullyController.java
@@ -21,7 +21,7 @@ public class CreateSuccessfullyController{
*/
public void backToLogin() {
Stage stage = (Stage) signUp.getScene().getWindow();
- new Loginbeginner();
+ new LoginBeginner();
stage.close();
}
diff --git a/src/imgzip/LoginSignIn/FindPasswordController.java b/src/imgzip/LoginSignIn/FindPasswordController.java
index 45c6cd4a576465162308fab9b5686a787a0a4e15..c5b01827943114df960412acda721e9cada291a8 100644
--- a/src/imgzip/LoginSignIn/FindPasswordController.java
+++ b/src/imgzip/LoginSignIn/FindPasswordController.java
@@ -99,7 +99,7 @@ public class FindPasswordController {
public void backToSignIn(){
Stage stage = (Stage) verify.getScene().getWindow();
- new Loginbeginner();
+ new LoginBeginner();
stage.close();
}
}
diff --git a/src/imgzip/LoginSignIn/Login.java b/src/imgzip/LoginSignIn/Login.java
index ed31a02f32bf1eb7df8a3a9584c1866c3d782ac3..a4fa463073ced7e7c035d4528571a09ef6155cd4 100644
--- a/src/imgzip/LoginSignIn/Login.java
+++ b/src/imgzip/LoginSignIn/Login.java
@@ -24,66 +24,62 @@ public class Login extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
+ Parent root = FXMLLoader.load(getClass().getResource("/fxml/Login.fxml"));
+
+ TextField account = (TextField)root.lookup("#Account");
+ PasswordField password = (PasswordField)root.lookup("#password");
+ CheckBox remember = (CheckBox)root.lookup("#remember");
+ Button logIn = (Button)root.lookup("#Login");
+ Label passwordWrong = (Label)root.lookup("#passwordWrong");
+ passwordWrong.setVisible(false);
+
+ /**
+ 在页面开启之前检查上一次登录时是否记住了密码,
+ 如果上一次登录点击了记住密码,则在本次打开时会将账号和密码写入
+ */
try {
- Parent root = FXMLLoader.load(getClass().getResource("/fxml/Login.fxml"));
-
- TextField account = (TextField)root.lookup("#Account");
- PasswordField password = (PasswordField)root.lookup("#password");
- CheckBox remember = (CheckBox)root.lookup("#remember");
- Button logIn = (Button)root.lookup("#Login");
- Label passwordWrong = (Label)root.lookup("#passwordWrong");
-
- /**
- 在页面开启之前检查上一次登录时是否记住了密码,
- 如果上一次登录点击了记住密码,则在本次打开时会将账号和密码写入
- */
- passwordWrong.setVisible(false);
-
- try {
- File file = new File("src/txtFile/RememberAccount&Password.txt");
- if(!file.exists()){
- file.createNewFile();
- }
-
- FileReader fr = new FileReader(file);
- BufferedReader br = new BufferedReader(fr);
-
- String line = "";
- line = br.readLine();
+ File fi = new File("txtFile");
+ File file = new File("txtFile/RememberAccount&Password.txt");
+ if(!fi.exists()){
+ fi.mkdir();
+ }
+ if(!file.exists()){
+ file.createNewFile();
+ }
+ FileReader fr = new FileReader(file);
+ BufferedReader br = new BufferedReader(fr);
- if(file.length() != 0){
+ String line = "";
+ line = br.readLine();
- String[] judge = line.split("\\|");
- String truejudge = "true";
- int accountIndex = 0;
- int passwordIndex = 1;
- int judgeIndex = 2;
+ if(file.length() != 0){
- if(judge[judgeIndex].equals(truejudge) ){
- account.setText(judge[accountIndex]);
- password.appendText(judge[passwordIndex]);
+ String[] judge = line.split("\\|");
+ String truejudge = "true";
+ int accountIndex = 0;
+ int passwordIndex = 1;
+ int judgeIndex = 2;
- remember.setSelected(true);
- logIn.setDisable(false);
- }
+ if(judge[judgeIndex].equals(truejudge) ){
+ account.setText(judge[accountIndex]);
+ password.appendText(judge[passwordIndex]);
- br.close();
- fr.close();
+ remember.setSelected(true);
+ logIn.setDisable(false);
}
-
- }catch (Exception e){
- e.printStackTrace();
+ br.close();
+ fr.close();
}
- primaryStage.setTitle("XXX login");
- primaryStage.setScene(new Scene(root, 638, 400));
- primaryStage.show();
}catch (Exception e){
e.printStackTrace();
+ }
- }
+ primaryStage.setTitle("XXX login");
+ primaryStage.setScene(new Scene(root, 638, 400));
+ primaryStage.show();
}
@@ -100,69 +96,69 @@ public class Login extends Application {
登录页面的启动类,写成构造方法形式被调用,方便该文件夹其他页面调用。
*/
-class Loginbeginner{
- public Loginbeginner(){
- try {
- Stage primaryStage = new Stage();
- Parent root = FXMLLoader.load(getClass().getResource("/fxml/Login.fxml"));
-
- TextField account = (TextField)root.lookup("#Account");
- PasswordField password = (PasswordField)root.lookup("#password");
- CheckBox remember = (CheckBox)root.lookup("#remember");
- Button logIn = (Button)root.lookup("#Login");
- Label passwordWrong = (Label)root.lookup("#passwordWrong");
- passwordWrong.setVisible(false);
-
- /**
- 在页面开启之前检查上一次登录时是否记住了密码,
- 如果上一次登录点击了记住密码,则在本次打开时会将账号和密码写入
- */
- try {
-
- File file = new File("src/txtFile/RememberAccount&Password.txt");
- if(!file.exists()){
- file.createNewFile();
- }
-
- File file1 = new File("src/txtFile/RememberAccount&Password.txt");
- FileReader fr = new FileReader(file1);
- BufferedReader br = new BufferedReader(fr);
-
- String line = "";
- line = br.readLine();
-
- if(file1.length() != 0){
-
- String[] judge = line.split("\\|");
- String truejudge = "true";
- int accountIndex = 0;
- int passwordIndex = 1;
- int judgeIndex = 2;
-
- if(judge[judgeIndex].equals(truejudge) ){
- account.setText(judge[accountIndex]);
- password.appendText(judge[passwordIndex]);
-
- remember.setSelected(true);
- logIn.setDisable(false);
- }
-
- br.close();
- fr.close();
- }
-
-
- }catch (Exception e){
- e.printStackTrace();
- }
-
- primaryStage.setTitle("XXX login");
- primaryStage.setScene(new Scene(root, 638, 400));
- primaryStage.show();
-
- }catch (Exception e){
- e.printStackTrace();
-
- }
- }
-}
\ No newline at end of file
+//class Loginbeginner{
+// public Loginbeginner(){
+// try {
+// Stage primaryStage = new Stage();
+// Parent root = FXMLLoader.load(getClass().getResource("/fxml/Login.fxml"));
+//
+// TextField account = (TextField)root.lookup("#Account");
+// PasswordField password = (PasswordField)root.lookup("#password");
+// CheckBox remember = (CheckBox)root.lookup("#remember");
+// Button logIn = (Button)root.lookup("#Login");
+// Label passwordWrong = (Label)root.lookup("#passwordWrong");
+// passwordWrong.setVisible(false);
+//
+// /**
+// 在页面开启之前检查上一次登录时是否记住了密码,
+// 如果上一次登录点击了记住密码,则在本次打开时会将账号和密码写入
+// */
+// try {
+//
+// File file = new File("src/txtFile/RememberAccount&Password.txt");
+// if(!file.exists()){
+// file.createNewFile();
+// }
+//
+// File file1 = new File("src/txtFile/RememberAccount&Password.txt");
+// FileReader fr = new FileReader(file1);
+// BufferedReader br = new BufferedReader(fr);
+//
+// String line = "";
+// line = br.readLine();
+//
+// if(file1.length() != 0){
+//
+// String[] judge = line.split("\\|");
+// String truejudge = "true";
+// int accountIndex = 0;
+// int passwordIndex = 1;
+// int judgeIndex = 2;
+//
+// if(judge[judgeIndex].equals(truejudge) ){
+// account.setText(judge[accountIndex]);
+// password.appendText(judge[passwordIndex]);
+//
+// remember.setSelected(true);
+// logIn.setDisable(false);
+// }
+//
+// br.close();
+// fr.close();
+// }
+//
+//
+// }catch (Exception e){
+// e.printStackTrace();
+// }
+//
+// primaryStage.setTitle("XXX login");
+// primaryStage.setScene(new Scene(root, 638, 400));
+// primaryStage.show();
+//
+// }catch (Exception e){
+// e.printStackTrace();
+//
+// }
+// }
+//}
\ No newline at end of file
diff --git a/src/imgzip/LoginSignIn/LoginBeginner.java b/src/imgzip/LoginSignIn/LoginBeginner.java
index 0bf981d80d6413a05e68dc048e3edb605181d125..12e6fb377df5e80ec5a2694bbb2587398a2c7e9e 100644
--- a/src/imgzip/LoginSignIn/LoginBeginner.java
+++ b/src/imgzip/LoginSignIn/LoginBeginner.java
@@ -1,3 +1,4 @@
+
package imgzip.LoginSignIn;
import imgzip.mainpane.Course;
@@ -11,7 +12,6 @@ import javafx.stage.Stage;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
-
/**
@Author: 肖尧
@Date: 2019.12.12
diff --git a/src/imgzip/LoginSignIn/WrongPasswordController.java b/src/imgzip/LoginSignIn/WrongPasswordController.java
index 28853c85f5ed5159646eb69cc213ea836757c063..5d3733107575bd7232bcf732815f6f7b24f8dc58 100644
--- a/src/imgzip/LoginSignIn/WrongPasswordController.java
+++ b/src/imgzip/LoginSignIn/WrongPasswordController.java
@@ -48,7 +48,7 @@ public class WrongPasswordController {
public void back(){
Stage stage = (Stage)back.getScene().getWindow();
- new Loginbeginner();
+ new LoginBeginner();
stage.close();
}
diff --git a/txtFile/RememberAccount&Password.txt b/txtFile/RememberAccount&Password.txt
new file mode 100644
index 0000000000000000000000000000000000000000..2b1676a04eda5f8991dec8219e543f34cd387d4c
--- /dev/null
+++ b/txtFile/RememberAccount&Password.txt
@@ -0,0 +1 @@
+admin|14789|true