From 1900f83b454d851f18ea72307036a7aeca280e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20K=C3=BChn?= Date: Thu, 25 Nov 2021 11:34:33 +0100 Subject: [PATCH] created new window --- .../app/build/resources/main/client/style.css | 4 ++++ .../src/main/java/client/MainController.java | 22 +++++++++++++++++++ .../main/resources/client/create-event.css | 3 +++ .../main/resources/client/create-event.fxml | 11 ++++++++++ 4 files changed, 40 insertions(+) create mode 100644 hellofx/app/src/main/resources/client/create-event.css create mode 100644 hellofx/app/src/main/resources/client/create-event.fxml diff --git a/hellofx/app/build/resources/main/client/style.css b/hellofx/app/build/resources/main/client/style.css index c650c9f..626bad8 100644 --- a/hellofx/app/build/resources/main/client/style.css +++ b/hellofx/app/build/resources/main/client/style.css @@ -2,6 +2,10 @@ GridPane{ -fx-background-color: #282C34; } +Label{ + -fx-text-fill: white; +} + .main-btn{ -fx-background-color: #ffffff; -fx-text-fill: white; diff --git a/hellofx/app/src/main/java/client/MainController.java b/hellofx/app/src/main/java/client/MainController.java index cd95f68..75ce427 100644 --- a/hellofx/app/src/main/java/client/MainController.java +++ b/hellofx/app/src/main/java/client/MainController.java @@ -1,13 +1,20 @@ package client; import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; +import javafx.stage.Modality; +import javafx.stage.Stage; import res.Event; import res.DataController; +import java.io.IOException; +import java.util.Objects; + public class MainController { @FXML private GridPane calendarGrid; @@ -30,6 +37,21 @@ public class MainController { @FXML protected void onAddBtnClick(){ + try{ + FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("create-event.fxml")); + Scene scene = new Scene(fxmlLoader.load(), 600, 400); + 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.showAndWait(); + } + catch (IOException e){ + e.printStackTrace(); + } + + DataController dataController = new DataController(); Event[] eventList = dataController.getAllEvents(); diff --git a/hellofx/app/src/main/resources/client/create-event.css b/hellofx/app/src/main/resources/client/create-event.css new file mode 100644 index 0000000..5094b00 --- /dev/null +++ b/hellofx/app/src/main/resources/client/create-event.css @@ -0,0 +1,3 @@ +GridPane{ + -fx-background-color: #3E415F; +} \ No newline at end of file diff --git a/hellofx/app/src/main/resources/client/create-event.fxml b/hellofx/app/src/main/resources/client/create-event.fxml new file mode 100644 index 0000000..68dfb48 --- /dev/null +++ b/hellofx/app/src/main/resources/client/create-event.fxml @@ -0,0 +1,11 @@ + + + + + + + + + + +