diff --git a/src/imgzip/mainpane/Change_email.java b/src/imgzip/mainpane/Change_email.java index 60cef765dfa9f11ff61c0105fccceb83c3a22c61..10a4e5ceddf0520a228e39903aa1b053b87fb506 100644 --- a/src/imgzip/mainpane/Change_email.java +++ b/src/imgzip/mainpane/Change_email.java @@ -10,6 +10,9 @@ import javafx.stage.Stage; @Date: 2019.12.17 */ public class Change_email { + /** + 加载更改邮箱的页面 + */ public Change_email(){ try { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Change_email.fxml")); diff --git a/src/imgzip/mainpane/Change_emailController.java b/src/imgzip/mainpane/Change_emailController.java index 8d6b25c741f4ac017f45ba15469b6ca3211467b2..34a2477187afd5e473d9c702f220b6e2c8edb0fe 100644 --- a/src/imgzip/mainpane/Change_emailController.java +++ b/src/imgzip/mainpane/Change_emailController.java @@ -29,15 +29,14 @@ public class Change_emailController implements Initializable { public void initialize(URL lacation, ResourceBundle resources){ -// if(a.length() != 0) { -// certain.setDisable(true); -// -// }else{ -// certain.setDisable(false); -// } + /** + 在Change_email中按确定按钮后把云端 + 数据库中对应的账号的邮箱换成TextField中的邮箱 + 并更新全局变量GlobalStringManager中的email + 结束后更新并打开personal + */ certain.setOnAction(e -> { a = text.getText(); -// GlobalStringManager.setEmial(a); DataBaseController loginInstruction = new DataBaseController(); ResultSet rs = null; String currentInstruction = "UPDATE login SET email=" + "'" + a + "'" + "WHERE username=" + "'" + GlobalStringManager.getAccount() + "'"; diff --git a/src/imgzip/mainpane/Change_tel.java b/src/imgzip/mainpane/Change_tel.java index ac22bd9faaaf4f847dbf09e137f0403728e2fc63..9455bdc4365b415d3b28f8735ac153ca66cdd231 100644 --- a/src/imgzip/mainpane/Change_tel.java +++ b/src/imgzip/mainpane/Change_tel.java @@ -9,6 +9,9 @@ import javafx.stage.Stage; @Date: 2019.12.19 */ public class Change_tel { + /** + 加载更改电话号码的页面 + */ public Change_tel(){ try { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Change_tel.fxml")); diff --git a/src/imgzip/mainpane/Change_telController.java b/src/imgzip/mainpane/Change_telController.java index e80eb120cc8adb242facd55405ecdae11e5655cc..c772e0c3b463e556cebadd244166dcc78c550a20 100644 --- a/src/imgzip/mainpane/Change_telController.java +++ b/src/imgzip/mainpane/Change_telController.java @@ -21,15 +21,14 @@ public class Change_telController implements Initializable { public void initialize(URL lacation, ResourceBundle resources){ -// if(a.length() != 0) { -// certain.setDisable(true); -// -// }else{ -// certain.setDisable(false); -// } + /** + 在Change_tel中按确定按钮后把云端 + 数据库中对应的账号的电话号码换成TextField中的电话号码 + 并更新全局变量GlobalStringManager中的tel + 结束后更新并打开personal页面 + */ certain.setOnAction(e -> { b = text.getText(); -// GlobalStringManager.setEmial(b); DataBaseController loginInstruction = new DataBaseController(); ResultSet rs = null; String currentInstruction = "UPDATE login SET tel=" + "'" + b + "'" + "WHERE username=" + "'" + GlobalStringManager.getAccount() + "'"; diff --git a/src/imgzip/mainpane/Course.java b/src/imgzip/mainpane/Course.java index ee00b742fe5cb985c3484a0033a4814f9c70915f..dc3548c0dc150f05269a5cab05c69a6018269891 100644 --- a/src/imgzip/mainpane/Course.java +++ b/src/imgzip/mainpane/Course.java @@ -13,6 +13,9 @@ import java.util.Objects; @Date: 2019.12.10 */ public class Course { + /** + 加载登陆后的course页面 + */ public Course(){ try { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Course.fxml")); @@ -25,6 +28,9 @@ public class Course { e.printStackTrace(); } } + /** + 加载没有登录前的页面 + */ public Course(int a){ try { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Course(none).fxml")); diff --git a/src/imgzip/mainpane/CourseController.java b/src/imgzip/mainpane/CourseController.java index a3aae5c4e61d195070adb2aba7ecdd3ee0bd430e..8005ef77326a16539cff66998c49069a1d6fe6b5 100644 --- a/src/imgzip/mainpane/CourseController.java +++ b/src/imgzip/mainpane/CourseController.java @@ -70,7 +70,7 @@ public class CourseController implements Initializable { }); /** - course页面自我更新到初始状态 + course页面自我更新 */ course.setOnAction(e -> { new Course(); @@ -106,8 +106,6 @@ public class CourseController implements Initializable { }); - - /** 把登录教程的gif放到page版面上 */ diff --git a/src/imgzip/mainpane/Pane_sceen.java b/src/imgzip/mainpane/Pane_sceen.java index 3cdae4bc49b6269289dea58224c3cf2282c24df9..679493ca266d2b6d07918817872c799aa921b335 100644 --- a/src/imgzip/mainpane/Pane_sceen.java +++ b/src/imgzip/mainpane/Pane_sceen.java @@ -11,6 +11,9 @@ import javafx.stage.Stage; @Date: 2019.12.8 */ public class Pane_sceen extends Application { + /** + 开启主页面 + */ @Override public void start(Stage primaryStage) throws Exception{ try { diff --git a/src/imgzip/mainpane/Pane_sceenController.java b/src/imgzip/mainpane/Pane_sceenController.java index 7e989574c327f8b506af88c2a54b6b5d0b57aa1a..c779069ded369744bfc2fd2731b4e8d45f5dc233 100644 --- a/src/imgzip/mainpane/Pane_sceenController.java +++ b/src/imgzip/mainpane/Pane_sceenController.java @@ -19,10 +19,6 @@ import javafx.stage.Stage; @Date: 2019.12.9 */ public class Pane_sceenController implements Initializable { - @FXML - private Label homepage; - @FXML - private Line line; @FXML private Button register; @FXML @@ -32,8 +28,6 @@ public class Pane_sceenController implements Initializable { @FXML private Button price; - @FXML - private Button personal; @Override public void initialize(URL lacation, ResourceBundle resources){ @@ -73,11 +67,6 @@ public class Pane_sceenController implements Initializable { stage.close(); }); -// personal.setOnAction(e -> { -// new Personal(); -// Stage stage = (Stage)personal.getScene().getWindow(); -// stage.close(); -// }); } } diff --git a/src/imgzip/mainpane/Pane_sceenbeginner.java b/src/imgzip/mainpane/Pane_sceenbeginner.java index cd88cba6243544446c404428a93a2ed86e86c37d..a2b44a9c7f1cb86840fa5a27c95b2c6a040ddc26 100644 --- a/src/imgzip/mainpane/Pane_sceenbeginner.java +++ b/src/imgzip/mainpane/Pane_sceenbeginner.java @@ -7,7 +7,9 @@ import javafx.scene.image.Image; import javafx.stage.Stage; public class Pane_sceenbeginner { - + /** + 别的页面在切换到主页面时可调用的创建主页面的方法 + */ public Pane_sceenbeginner(){ try { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Pane_sceen.fxml")); diff --git a/src/imgzip/mainpane/Personal.java b/src/imgzip/mainpane/Personal.java index 637955fdd9e3392a3658cc613a7164b0e9b8b08c..fee934b44d28c0793d3520b5f4ef960d1a721a9e 100644 --- a/src/imgzip/mainpane/Personal.java +++ b/src/imgzip/mainpane/Personal.java @@ -20,27 +20,6 @@ import java.sql.SQLException; @Author: 吴泳仪 @Date: 2019.12.14 */ -//class Personalbeginner extends Application { -// @Override -// public void start(Stage primaryStage) throws Exception{ -// try { -// Parent root=FXMLLoader.load(getClass().getResource("/fxml/Personal.fxml")); -// primaryStage.setTitle("Homepage"); -// primaryStage.setScene(new Scene(root, 939, 685)); -// primaryStage.show(); -// -// }catch (Exception e){ -// e.printStackTrace(); -// -// } -// -// } -// -// public static void main(String[] args) { -// launch(args); -// } -// -//} public class Personal { @@ -49,34 +28,38 @@ public class Personal { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Personal.fxml")); + //Personal的fxml中的pane组件 Pane accountp = (Pane)root.lookup("#accountp"); Pane emailp = (Pane)root.lookup("#emailp"); Pane telp= (Pane)root.lookup("#telp"); + //新建一个DataBaseController类的实体 DataBaseController loginInstruction = new DataBaseController(); ResultSet rs = null; try{ + //用于执行的sql语句,选择用户名为登录时用户名的账户的所有信息 String currentInstruction = "SELECT * FROM login WHERE userName=" + "'" +GlobalStringManager.getAccount()+ "'"; rs = loginInstruction.queryExcecute(currentInstruction); if (rs.next()) { - + //把从数据库中读出来的用户名利用label显示在页面上 + //并把用户名保存到GlobalStringManager中 Label a = new Label(rs.getString(1)); a.setStyle("-fx-font-family: 'FangSong';-fx-font-size: 20;"); accountp.getChildren().add(a); GlobalStringManager.setAccount(rs.getString(1)); - + //把从数据库中读出来的email利用label显示在页面上 + //并把email保存到GlobalStringManager中 Label e = new Label(rs.getString(3)); e.setStyle("-fx-font-family: 'FangSong';-fx-font-size: 20;"); emailp.getChildren().add(e); GlobalStringManager.setEmial(rs.getString(3)); - + //把从数据库中读出来的电话号码利用label显示在页面上 Label t = new Label(rs.getString(4)); t.setStyle("-fx-font-family: 'FangSong';-fx-font-size: 20;"); telp.getChildren().add(t); } - }catch (SQLException e){ e.printStackTrace(); diff --git a/src/imgzip/mainpane/PersonalController.java b/src/imgzip/mainpane/PersonalController.java index 74d7d30a6d64f6eda7f429854210e98ab45943f2..1b5678337ead22e6508c397d01234311611193a3 100644 --- a/src/imgzip/mainpane/PersonalController.java +++ b/src/imgzip/mainpane/PersonalController.java @@ -35,10 +35,7 @@ public class PersonalController implements Initializable { private Button changetel; @FXML private Button changepw; -// @FXML -// public static Pane accountp; -// @FXML -// private Pane emailp; + public void initialize(URL lacation, ResourceBundle resources){ /** @@ -79,7 +76,7 @@ public class PersonalController implements Initializable { /** - 修改邮箱 + 加载修改邮箱的页面Change_email */ changeemail.setOnAction(e -> { new Change_email(); @@ -88,7 +85,7 @@ public class PersonalController implements Initializable { }); /** - 修改电话号 + 加载修改电话号的页面Change_tel */ changetel.setOnAction(e -> { new Change_tel(); @@ -97,7 +94,7 @@ public class PersonalController implements Initializable { }); /** - 修改密码 + 加载修改密码的页面 */ changepw.setOnAction(e -> { new ChangePassword(1); diff --git a/src/imgzip/mainpane/Priceimg.java b/src/imgzip/mainpane/Priceimg.java index 141b64982899a693af5de8eff5c56dba3c2996d8..a60219fec4f84e0dc77e24a583919c60e97c29b3 100644 --- a/src/imgzip/mainpane/Priceimg.java +++ b/src/imgzip/mainpane/Priceimg.java @@ -9,6 +9,9 @@ import javafx.stage.Stage; @Date: 2019.12.18 */ public class Priceimg { + /** + 加载显示微信收费的页面 + */ public Priceimg(){ try { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Priceimg.fxml")); diff --git a/src/imgzip/mainpane/Pricepane.java b/src/imgzip/mainpane/Pricepane.java index 4d9ac3920418aa90d1cfce557042d542b4df2c33..e8b7be9bf9e62736f9c8fecdfca7ec9d022bc314 100644 --- a/src/imgzip/mainpane/Pricepane.java +++ b/src/imgzip/mainpane/Pricepane.java @@ -10,6 +10,9 @@ import javafx.stage.Stage; @Date: 2019.12.9 */ public class Pricepane{ + /** + 加载登录后price的页面可调用的构造函数 + */ public Pricepane(){ try { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Pricepane.fxml")); @@ -22,6 +25,9 @@ public class Pricepane{ e.printStackTrace(); } } + /** + 加载登陆前price的页面可调用的构造函数 + */ public Pricepane(int a){ try { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Pricepane(none).fxml")); diff --git a/src/imgzip/mainpane/PricepaneController.java b/src/imgzip/mainpane/PricepaneController.java index b9129e7dc994157f979c0cc92f7b9323197346db..09bf4c078e522f6511210474ce4a1d9f1ff7901d 100644 --- a/src/imgzip/mainpane/PricepaneController.java +++ b/src/imgzip/mainpane/PricepaneController.java @@ -78,14 +78,14 @@ public class PricepaneController implements Initializable { }); /** - 本页面连接到priceimg + 本页面连接到priceimg(微信收费二维码页面) */ button1.setOnAction(e -> { new Priceimg(); }); /** - 本页面连接到priceimg + 本页面连接到priceimg(微信收费二维码页面) */ button3.setOnAction(e -> { new Priceimg(); diff --git a/src/imgzip/mainpane/PricepaneControllernone.java b/src/imgzip/mainpane/PricepaneControllernone.java index 4ceaa4628fe059494f65b4ac21d949a692363505..d3c153ed5bef306fa525f94f9e6ce305e68ee744 100644 --- a/src/imgzip/mainpane/PricepaneControllernone.java +++ b/src/imgzip/mainpane/PricepaneControllernone.java @@ -65,14 +65,14 @@ public class PricepaneControllernone implements Initializable { }); /** - 本页面连接到priceimg + 本页面连接到priceimg(微信收费二维码) */ button1.setOnAction(e -> { new Priceimg(); }); /** - 本页面连接到priceimg + 本页面连接到priceimg(微信收费二维码) */ button3.setOnAction(e -> { new Priceimg(); diff --git a/txtFile/RememberAccount&Password.txt b/txtFile/RememberAccount&Password.txt index 6029f262eae5a78d10984189adeeaa86e76c3b80..da6f3a9768ceee85123c01fed3b4a619609d8319 100644 --- a/txtFile/RememberAccount&Password.txt +++ b/txtFile/RememberAccount&Password.txt @@ -1 +1 @@ -asdfg|asdfg|true +asdfgh|asdfgh|true