Created a class FanStackPane, which is inherited from the usual StackPane, in order to arrange the elements as I want. But now when the program starts, the error Caused by: java.lang.ClassNotFoundException: Main.GameWindow $ FanStackPane crashes, it confuses me with $.
Here is the FXML code:
<?import Main.GameWindow.FanStackPane?> <AnchorPane prefHeight="768.0" prefWidth="1366.0" style="-fx-background-color: transparent;" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Main.GameWindow.GameController"> <children> <ImageView fitHeight="768.0" fitWidth="1366.0" layoutY="-4.0"> <image> <Image url="@../Additions/gameTable.png" /> </image> </ImageView> <AnchorPane layoutX="366.0" layoutY="474.0" prefHeight="159.0" prefWidth="829.0" /> <FanStackPane fx:id="stackPane" layoutX="333.0" layoutY="651.0" prefHeight="177.0" prefWidth="591.0"> <children> Then just the elements and closing FanStackPane.
But loading windows
gameLoader.setLocation(getClass().getResource("/Main/GameWindow/Game.fxml")); Parent gameRoot = gameLoader.load();