added a sample nested controller

This commit is contained in:
Jannik 2019-06-16 13:00:29 +02:00
parent bb8bcd460a
commit f23e6c77ea
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
5 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package kellerkinder.HomeFlix.application;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
public class FilmDetailView {
@FXML private Label lblFilm;
public void initialize() {
System.out.println("init nested controller");
}
public void foo() {
System.out.println("test");
}
}

View File

@ -34,6 +34,7 @@ import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;

View File

@ -164,6 +164,9 @@ public class MainWindowController {
@FXML private ScrollPane posterModeScrollPane;
@FXML private FlowPane posterModeFlowPane;
// FilmDetailView
@FXML private FilmDetailView filmDetailViewController;
private DBController dbController;
private UpdateController updateController;
private XMLController xmlController;
@ -498,6 +501,7 @@ public class MainWindowController {
@FXML
private void returnBtnclicked() {
filmsTreeTable.getSelectionModel().select(last);
filmDetailViewController.foo();
}
@FXML

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane prefHeight="568.0" prefWidth="980.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="kellerkinder.HomeFlix.application.FilmDetailView">
<children>
<Label fx:id="lblFilm" layoutX="461.0" layoutY="277.0" text="Test Pane" />
</children>
</AnchorPane>

View File

@ -74,6 +74,9 @@
</FlowPane>
</content>
</ScrollPane>
<AnchorPane>
<fx:include source="/fxml/FilmDetailView.fxml" fx:id="filmDetailView" />
</AnchorPane>
<ScrollPane fx:id="settingsScrollPane" fitToHeight="true" fitToWidth="true" prefHeight="568.0" prefWidth="800.0" style="-fx-background: white;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="32.0">
<content>
<AnchorPane fx:id="settingsAnchorPane" style="-fx-background-color: white;">