diff --git a/src/main/java/projekt/enigma/App.java b/src/main/java/projekt/enigma/App.java new file mode 100644 index 0000000000000000000000000000000000000000..f53dcdf988f86a5bedf676f34009bdcaf9fcf9d5 --- /dev/null +++ b/src/main/java/projekt/enigma/App.java @@ -0,0 +1,66 @@ +package projekt.enigma; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; + +import java.io.IOException; + +/** + * JavaFX App + */ +public class App extends Application { + + /** + * TODO Dokumentieren + */ + private static Scene scene; + + /** + * TODO Dokumentieren + * + * @param fxml + * @throws IOException + */ + static void setRoot(String fxml) throws IOException { + scene.setRoot(loadFXML(fxml)); + } + + /** + * TODO Dokumentieren + * + * @param fxml + * @return + * @throws IOException + */ + private static Parent loadFXML(String fxml) throws IOException { + FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); + return fxmlLoader.load(); + } + + /** + * TODO Dokumentieren + * + * @param args + */ + public static void main(String[] args) { + Application.launch(); + } + + /** + * TODO Dokumentieren + * + * @param stage + * @throws IOException + */ + @Override + public void start(Stage stage) throws IOException { + scene = new Scene(loadFXML("kenngruppe")); + stage.setScene(scene); + stage.setResizable(true); + stage.show(); + } + +}