package de.fhswf.in.inf.java2.aufgabe05; import java.io.IOException; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.control.SplitPane; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; public class MainApplication extends Application { private Stage primaryStage; private BorderPane rootLayout; @Override public void start(Stage primaryStage) { this.primaryStage = primaryStage; this.primaryStage.setTitle("ThemeChooser"); initRootLayout(); showDirectoryOverview(); } private void initRootLayout() { try { // Load root layout from fxml file. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApplication.class.getResource("view/RootLayout.fxml")); rootLayout = (BorderPane) loader.load(); // Show the scene containing the root layout. Scene scene = new Scene(rootLayout); primaryStage.setScene(scene); // Give the controller access to the main app. // RootLayoutController controller = loader.getController(); // controller.setMainApp(this); primaryStage.show(); } catch (IOException e) { e.printStackTrace(); } } private void showDirectoryOverview() { try { // Load person overview. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApplication.class .getResource("view/DirectoryOverview.fxml")); AnchorPane personOverview = (AnchorPane) loader.load(); // Set person overview into the center of root layout. rootLayout.setCenter(personOverview); // Give the controller access to the main app. // DirectoryOverviewController controller = loader.getController(); // controller.setMainApp(this); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { launch(args); } }