i need to load an fxml based JavaFX Scene in Clojure, but when i try to load the resource "view.fxml" it returns nil.
Here is my present code:
(ns ui.ui_controller
(:import (javafx.application Application)
(javafx.fxml FXMLLoader)
(javafx.scene Scene)
(javafx.stage Stage)))
(gen-class
:name ui.ui_controller
:extends javafx.application.Application)
(defn -main [& args]
(Application/launch ui.ui_controller args))
(defn -start [this stage]
(let [loc (clojure.java.io/resource "view.fxml")
root (FXMLLoader/load loc)]
(.setScene stage (Scene. root))
(.setTitle stage "JavaFXML with Clojure Example")
(.show stage)))
And in the resources folder is the view.fxml file, which should be loaded.
When in call (println (clojure.java.io/resource "view.fxml")) it returns nil...
Any idea what goes wrong here?
Thanks!
Here is an example