|
|
// com/ui/PasswordModifyPage.java
|
|
|
package com.pair.ui;
|
|
|
|
|
|
import javafx.geometry.Pos;
|
|
|
import javafx.scene.control.*;
|
|
|
import javafx.scene.layout.VBox;
|
|
|
import javafx.scene.text.Font;
|
|
|
import javafx.scene.text.FontWeight;
|
|
|
|
|
|
public class PasswordModifyPage extends NavigablePanel {
|
|
|
|
|
|
private final PasswordField oldPasswordField = new PasswordField();
|
|
|
private final PasswordField newPasswordField = new PasswordField();
|
|
|
private final PasswordField confirmNewPasswordField = new PasswordField();
|
|
|
private final Button modifyButton = new Button("修改");
|
|
|
|
|
|
public PasswordModifyPage(Runnable onBack) {
|
|
|
super(onBack);
|
|
|
initializeContent();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void buildContent() {
|
|
|
VBox form = new VBox(UIConstants.DEFAULT_SPACING);
|
|
|
form.setAlignment(Pos.CENTER);
|
|
|
form.setPadding(UIConstants.DEFAULT_PADDING);
|
|
|
form.setStyle(UIConstants.FORM_STYLE);
|
|
|
|
|
|
Label titleLabel = new Label("中小学数学答题系统");
|
|
|
titleLabel.setFont(Font.font(UIConstants.FONT_FAMILY, FontWeight.BOLD, UIConstants.TITLE_FONT_SIZE));
|
|
|
|
|
|
oldPasswordField.setPromptText("旧密码");
|
|
|
oldPasswordField.setStyle(UIConstants.INPUT_STYLE);
|
|
|
newPasswordField.setPromptText("新密码(6-10位)");
|
|
|
newPasswordField.setStyle(UIConstants.INPUT_STYLE);
|
|
|
confirmNewPasswordField.setPromptText("确认新密码");
|
|
|
confirmNewPasswordField.setStyle(UIConstants.INPUT_STYLE);
|
|
|
modifyButton.setStyle(UIConstants.BUTTON_STYLE);
|
|
|
modifyButton.setPrefSize(UIConstants.BUTTON_WIDTH, UIConstants.BUTTON_HEIGHT);
|
|
|
modifyButton.setFont(Font.font(UIConstants.FONT_FAMILY, UIConstants.BUTTON_FONT_SIZE));
|
|
|
|
|
|
form.getChildren().addAll(
|
|
|
titleLabel, oldPasswordField, newPasswordField, confirmNewPasswordField, modifyButton
|
|
|
);
|
|
|
this.setCenter(form);
|
|
|
}
|
|
|
|
|
|
public PasswordField getOldPasswordField() { return oldPasswordField; }
|
|
|
public PasswordField getNewPasswordField() { return newPasswordField; }
|
|
|
public PasswordField getConfirmNewPasswordField() { return confirmNewPasswordField; }
|
|
|
public Button getModifyButton() { return modifyButton; }
|
|
|
} |