From 400ffb0e985a5e79d99a8c1ea0a0d44f4c9a8503 Mon Sep 17 00:00:00 2001 From: Reshad Meher Date: Tue, 17 Jan 2023 22:30:56 +0100 Subject: [PATCH] ParetSence --- .../HelloApplication.java | 15 ++++++------- .../MenueController.java | 21 +++++++++++++++++++ .../menue-view.fxml | 4 ++-- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java b/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java index e0045a2..6f0cb79 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/HelloApplication.java @@ -2,6 +2,7 @@ package com.bib.essensbestellungsverwaltung; import javafx.application.Application; import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; @@ -9,17 +10,17 @@ import java.io.IOException; public class HelloApplication extends Application { @Override - public void start(Stage stage) throws IOException { - FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml")); + public void start(Stage primaryStage) throws IOException { + Parent fxmlStartSeiteLoader = FXMLLoader.load(HelloApplication.class.getResource("menue-view.fxml")); /** - * @autor: Reshad Meher + * @author: Reshad Meher * Fenstergrößer * Fenstertitle */ - Scene scene = new Scene(fxmlLoader.load(), 480, 280); - stage.setTitle("Essen Bestellung im Kindergarten"); - stage.setScene(scene); - stage.show(); + primaryStage.setTitle("Essen Bestellung im Kindergarten"); + primaryStage.setScene(new Scene(fxmlStartSeiteLoader,950,480)); + primaryStage.show(); + } public static void main(String[] args) { diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java index 2c708ba..c52b33a 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java @@ -1,4 +1,25 @@ +/** + * Author: Reshad Meher + * Startseite + * fxml: menue-view.fxml + */ + package com.bib.essensbestellungsverwaltung; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.stage.Stage; + +import java.io.IOException; public class MenueController { + + @FXML + private void onBtLoginClick(){ + Alert alert = new Alert(Alert.AlertType.ERROR, "Hi"); + alert.showAndWait(); + } } diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml index 1099d47..b8776e9 100644 --- a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml +++ b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml @@ -11,10 +11,10 @@ -