I cannot figure out why my custom Stackpane does not appear. I have exported it to scenebuilder and scenebuilder also does not show my items in stack pane. Also i set blue background and it worked. Everything went blue. When i include my fxml directly, it works correctly but not when i use custom component aproach. I managed to get my button showing when it was not in pane. Is this layout issue or am i missing something.
public class TestPane extends StackPane{
public TestPane() {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(
"/fxml/components/TestPane.fxml"));
//Set controller fot opened dialogWindow
fxmlLoader.setController(this);
try {
fxmlLoader.load();
} catch (IOException exc) {
System.out.println("Error: " + exc.toString());
}
}
TestPane
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Button mnemonicParsing="false" text="Button" />
</children>
</StackPane>