added abort button

This commit is contained in:
Marco Kühn 2021-11-25 21:12:45 +01:00
parent 2785c04d78
commit 6fe7cb06c1
3 changed files with 24 additions and 3 deletions

View File

@ -10,6 +10,7 @@ import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import res.Event;
import res.DataController;
@ -41,13 +42,14 @@ public class MainController {
protected void onAddBtnClick(){
try{
FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("create-event.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 700, 500);
Scene scene = new Scene(fxmlLoader.load(), 850, 500);
scene.getStylesheets().add(Objects.requireNonNull(MainApplication.class.getResource("create-event.css")).toExternalForm());
Stage stage = new Stage();
stage.setTitle("Termin erstellen");
stage.setScene(scene);
stage.initModality(Modality.APPLICATION_MODAL);
stage.setResizable(false);
stage.initStyle(StageStyle.UNDECORATED);
stage.showAndWait();
}
catch (IOException e){
@ -71,4 +73,10 @@ public class MainController {
Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
stage.close();
}
@FXML
protected void abortBtnClick(ActionEvent event){
Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
stage.close();
}
}

View File

@ -3,6 +3,12 @@ GridPane{
-fx-padding: 20px;
-fx-font-size: 20px;
-fx-font-family: Segoe UI;
-fx-border-insets: 1;
-fx-border-color: white;
-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{
@ -22,4 +28,8 @@ Label{
.inputField{
-fx-padding: 10px;
}
.mainButton{
-fx-font-weight: bold;
}

View File

@ -3,6 +3,7 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import com.sun.javafx.scene.control.DatePickerContent?>
<GridPane xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.MainController">
<columnConstraints>
@ -10,6 +11,7 @@
<ColumnConstraints/>
<ColumnConstraints/>
<ColumnConstraints halignment="RIGHT"/>
<ColumnConstraints halignment="RIGHT"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="ALWAYS" />
@ -33,11 +35,12 @@
<DatePicker GridPane.columnIndex="2" GridPane.rowIndex="1" maxWidth="300" minWidth="300"/>
<TextField GridPane.columnIndex="2" GridPane.rowIndex="2" maxWidth="300" minWidth="300"/>
<DatePicker GridPane.columnIndex="2" GridPane.rowIndex="3" maxWidth="300" minWidth="300"/>
<DatePicker GridPane.columnIndex="2" GridPane.rowIndex="3" maxWidth="300" minWidth="300"/>
<ComboBox GridPane.columnIndex="2" GridPane.rowIndex="4" maxWidth="300" minWidth="300"/>
<ComboBox GridPane.columnIndex="2" GridPane.rowIndex="5" maxWidth="100" minWidth="100"/>
<CheckBox GridPane.columnIndex="2" GridPane.rowIndex="6"/>
<Button GridPane.columnIndex="3" GridPane.rowIndex="7" onAction="#createBtnClick" >Anlegen</Button>
<Button styleClass="mainButton" GridPane.columnIndex="4" GridPane.rowIndex="7" onAction="#createBtnClick" maxWidth="150" minWidth="150">Anlegen</Button>
<Button GridPane.columnIndex="3" GridPane.rowIndex="7" onAction="#abortBtnClick" maxWidth="150" minWidth="150" >Abbrechen</Button>
</GridPane>