Styled login

This commit is contained in:
Marc Beyer 2021-12-21 08:56:07 +01:00
parent e7b376e722
commit ded0b9042f
3 changed files with 40 additions and 2 deletions

View File

@ -22,6 +22,7 @@ public class LoginController {
protected void login(ActionEvent event){ protected void login(ActionEvent event){
if(userField.getText().trim().isEmpty()){ if(userField.getText().trim().isEmpty()){
userErrLabel.setText("Bitte laginnamen eingeben!"); userErrLabel.setText("Bitte laginnamen eingeben!");
passErrLabel.setText("");
return; return;
} }
if(passField.getText().trim().isEmpty()){ if(passField.getText().trim().isEmpty()){

View File

@ -0,0 +1,37 @@
* {
-fx-base-background-color: #2B2D42;
-fx-base1-background-color: #525E74;
-fx-main-border-color: #B0B0B0;
-fx-main-text-color: #ffffff;
}
GridPane{
-fx-background-color: #3E415F;
-fx-padding: 20px;
-fx-font-size: 20px;
-fx-font-family: Segoe UI;
-fx-border-insets: 1;
-fx-border-color: #B0B0B0;
-fx-border-style: solid;
-fx-border-width: 2;
-fx-effect: dropshadow(three-pass-box, rgba(100, 100, 100, 1), 24, 0.5, 0, 0);
}
Label{
-fx-text-fill: white;
-fx-max-width: 150px;
-fx-min-width: 150px;
}
.errorLbl{
-fx-font-weight: bold;
-fx-max-width: 200px;
-fx-text-fill: #ff5555;
-fx-padding: 16px;
-fx-min-height: 140px;
-fx-max-height: 400px;
-fx-wrap-text: true;
-fx-font-size: 16px;
}

View File

@ -20,11 +20,11 @@
<Label GridPane.rowIndex="1">Username</Label> <Label GridPane.rowIndex="1">Username</Label>
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" fx:id="userField" /> <TextField GridPane.columnIndex="1" GridPane.rowIndex="1" fx:id="userField" />
<Label GridPane.columnIndex="2" GridPane.rowIndex="1" fx:id="userErrLabel"/> <Label styleClass="errorLbl" GridPane.columnIndex="2" GridPane.rowIndex="1" fx:id="userErrLabel"/>
<Label GridPane.rowIndex="2">Paswort</Label> <Label GridPane.rowIndex="2">Paswort</Label>
<PasswordField GridPane.columnIndex="1" GridPane.rowIndex="2" fx:id="passField" /> <PasswordField GridPane.columnIndex="1" GridPane.rowIndex="2" fx:id="passField" />
<Label GridPane.columnIndex="2" GridPane.rowIndex="2" fx:id="passErrLabel"/> <Label styleClass="errorLbl" GridPane.columnIndex="2" GridPane.rowIndex="2" fx:id="passErrLabel"/>
<Button onAction="#abortBtnClick" GridPane.columnIndex="1" GridPane.rowIndex="3">Beenden</Button> <Button onAction="#abortBtnClick" GridPane.columnIndex="1" GridPane.rowIndex="3">Beenden</Button>
<Button onAction="#login" GridPane.columnIndex="2" GridPane.rowIndex="3">Anmelden</Button> <Button onAction="#login" GridPane.columnIndex="2" GridPane.rowIndex="3">Anmelden</Button>