improved the edit,create-user to JFX

This commit is contained in:
Alex Aleksej Rechtin 2022-02-07 13:48:58 +01:00
parent af441656de
commit 111d5758e0
4 changed files with 35 additions and 26 deletions

View File

@ -1,14 +1,14 @@
//Alex Rechtin// //Alex Rechtin//
package users; package users;
import com.jfoenix.controls.JFXPasswordField;
import com.jfoenix.controls.JFXTextField;
import com.jfoenix.controls.JFXToggleButton;
import helper.HttpRequestException; import helper.HttpRequestException;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleButton;
import javafx.stage.Stage; import javafx.stage.Stage;
import container.DataController; import container.DataController;
import container.User; import container.User;
@ -18,17 +18,17 @@ import java.util.Objects;
public class CreateUserController { public class CreateUserController {
@FXML @FXML
protected TextField textName; protected JFXTextField textName;
@FXML @FXML
protected PasswordField textPassword; protected JFXPasswordField textPassword;
@FXML @FXML
protected PasswordField textPasswordSecond; protected JFXPasswordField textPasswordSecond;
@FXML @FXML
protected ToggleButton checkButtonIsAdmin; protected JFXToggleButton checkButtonIsAdmin;
@FXML @FXML
protected TextField textLogin; protected JFXTextField textLogin;
@FXML @FXML
protected TextField textForename; protected JFXTextField textForename;
@FXML @FXML
protected Label labelError; protected Label labelError;

View File

@ -1,6 +1,7 @@
/*Alex Rechtin*/ /*Alex Rechtin*/
* { * {
-fx-dark-background-color: #3E415F; -fx-dark-background-color: #3E415F;
-fx-bright-background-color: #ffffff;
-fx-bright-border-color: #B0B0B0; -fx-bright-border-color: #B0B0B0;
-fx-brighter-text-color: #ff5555; -fx-brighter-text-color: #ff5555;
-fx-brightest-text-color: #ffffff; -fx-brightest-text-color: #ffffff;
@ -36,6 +37,7 @@ Label{
} }
.textField{ .textField{
-fx-background-color: -fx-bright-background-color;
-fx-max-width: 400px; -fx-max-width: 400px;
-fx-min-width: 400px; -fx-min-width: 400px;
} }
@ -46,7 +48,8 @@ Label{
-fx-text-fill: -fx-brighter-text-color; -fx-text-fill: -fx-brighter-text-color;
} }
Button{ JFXButton{
-fx-background-color: -fx-bright-background-color;
-fx-max-width: 150px; -fx-max-width: 150px;
-fx-min-width: 150px; -fx-min-width: 150px;
} }

View File

@ -2,10 +2,13 @@
<!-- Alex Rechtin --> <!-- Alex Rechtin -->
<?import javafx.scene.control.*?> <?import javafx.scene.control.Label?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import com.jfoenix.controls.JFXToggleButton?> <?import com.jfoenix.controls.JFXToggleButton?>
<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXPasswordField?>
<?import com.jfoenix.controls.JFXTextField?>
<GridPane xmlns="http://javafx.com/javafx" <GridPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml" xmlns:fx="http://javafx.com/fxml"
fx:controller="users.CreateUserController"> fx:controller="users.CreateUserController">
@ -37,11 +40,11 @@
<Label styleClass="inputLabelAdmin" GridPane.rowIndex="6" GridPane.columnIndex="1">Admin:</Label> <Label styleClass="inputLabelAdmin" GridPane.rowIndex="6" GridPane.columnIndex="1">Admin:</Label>
<TextField fx:id="textLogin" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="1" /> <JFXTextField fx:id="textLogin" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<TextField fx:id="textForename" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="2" /> <JFXTextField fx:id="textForename" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField fx:id="textName" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="3" /> <JFXTextField fx:id="textName" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<PasswordField fx:id="textPassword" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="4" /> <JFXPasswordField fx:id="textPassword" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<PasswordField fx:id="textPasswordSecond" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="5" /> <JFXPasswordField fx:id="textPasswordSecond" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="5" />
<JFXToggleButton fx:id="checkButtonIsAdmin" GridPane.columnIndex="2" GridPane.rowIndex="6"/> <JFXToggleButton fx:id="checkButtonIsAdmin" GridPane.columnIndex="2" GridPane.rowIndex="6"/>
@ -51,8 +54,8 @@
<HBox.margin> <HBox.margin>
<Insets right="100" left="100"/> <Insets right="100" left="100"/>
</HBox.margin> </HBox.margin>
<Button onAction="#abortBtnClick">Abbrechen</Button> <JFXButton onAction="#abortBtnClick">Abbrechen</JFXButton>
<Button onAction="#createUser" styleClass="btnLogin" >Anlegen</Button> <JFXButton onAction="#createUser" styleClass="btnLogin" >Anlegen</JFXButton>
</HBox> </HBox>
</GridPane> </GridPane>

View File

@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Alex Rechtin--> <!-- Alex Rechtin-->
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import com.jfoenix.controls.JFXToggleButton?> <?import com.jfoenix.controls.JFXToggleButton?>
<?import com.jfoenix.controls.JFXTextField?>
<?import com.jfoenix.controls.JFXPasswordField?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.control.Label?>
<GridPane xmlns="http://javafx.com/javafx" <GridPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml" xmlns:fx="http://javafx.com/fxml"
fx:controller="users.EditUserController"> fx:controller="users.EditUserController">
@ -36,11 +39,11 @@
<Label styleClass="inputLabelAdmin" GridPane.rowIndex="6" GridPane.columnIndex="1">Admin:</Label> <Label styleClass="inputLabelAdmin" GridPane.rowIndex="6" GridPane.columnIndex="1">Admin:</Label>
<TextField fx:id="textLogin" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="1" /> <JFXTextField fx:id="textLogin" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<TextField fx:id="textForename" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="2" /> <JFXTextField fx:id="textForename" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField fx:id="textName" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="3" /> <JFXTextField fx:id="textName" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<PasswordField fx:id="textPassword" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="4" /> <JFXPasswordField fx:id="textPassword" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<PasswordField fx:id="textPasswordSecond" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="5" /> <JFXPasswordField fx:id="textPasswordSecond" styleClass="textField" GridPane.columnIndex="2" GridPane.rowIndex="5" />
<JFXToggleButton fx:id="checkButtonIsAdmin" GridPane.columnIndex="2" GridPane.rowIndex="6"/> <JFXToggleButton fx:id="checkButtonIsAdmin" GridPane.columnIndex="2" GridPane.rowIndex="6"/>
@ -50,8 +53,8 @@
<HBox.margin> <HBox.margin>
<Insets right="100" left="100"/> <Insets right="100" left="100"/>
</HBox.margin> </HBox.margin>
<Button onAction="#abortBtnClick">Abbrechen</Button> <JFXButton onAction="#abortBtnClick">Abbrechen</JFXButton>
<Button onAction="#createUser" styleClass="btnLogin" >Bearbeiten</Button> <JFXButton onAction="#createUser" styleClass="btnLogin" >Bearbeiten</JFXButton>
</HBox> </HBox>
</GridPane> </GridPane>