public void showPokerTable() { try { // Load person overview. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApp.class.getResource("view/PokerTable.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. PokerTableController controller = loader.getController(); controller.setMainApp(this); } catch (IOException e) { e.printStackTrace(); } }