edvin / tornadofx

Lightweight JavaFX Framework for Kotlin
Apache License 2.0
3.67k stars 269 forks source link

Fxml Loader Class not found #1335

Open GnuaAruht opened 3 years ago

GnuaAruht commented 3 years ago

When I use fxml for ui resources, fxml loader class is not found.

My View class class CounterView : View() { override val root: BorderPane by fxml() } Fxml file is located under resources directory `<?xml version="1.0" encoding="UTF-8"?> <?import javafx.geometry.Insets?> <?import javafx.scene.control.Button?> <?import javafx.scene.control.Label?> <?import javafx.scene.layout.BorderPane?> <?import javafx.scene.layout.VBox?> <?import javafx.scene.text.Font?>

`
SchweinchenFuntik commented 3 years ago

provide the FXMl header and stacktrace. Also provide the paths where your FXML-file is located.

Fxml file is located under resources directory

at the root of the resource? then it is not a valid file path.

View and FXML-file must be in the same package or you must specify the path manually. Documentation: https://edvin.gitbooks.io/tornadofx-guide/content/part1/10_FXML.html