Issue
Does anyone know where in an sbt directory structure ScalaFX looks for CSS style sheets? I've tried putting them in the same directory as my ScalaFX app main file, in a resources directory, directly in src, and pretty much everywhere else - yet every time I get a message saying Resource "whatever path I'm using/style.css" not found
.
Solution
In SBT project you put CSS stylesheets in src/main/resources
You can see an example project using CSS here https://github.com/scalafx/scalafx-ensemble
Assuming that your stylesheet is in src/main/resources/path/my.css
you can load it like this
scene = new Scene {
stylesheets += this.getClass.getResource("/path/my.css").toExternalForm
...
}
Answered By - Jarek
Answer Checked By - Terry (JavaFixing Volunteer)