I would like to add a CSS file which is located somewhere on the filesystem. The purpose is to write an application where the user can add JavaFX CSS files (which are create
The exception is thrown because the string "C:/test.css" is not a URI resource. Therefore you must convert your string into a URI resource.
"C:/test.css"
As of Java 7 you can do:
String uri = Paths.get("C:/test.css").toUri().toString(); scene.getStylesheets().add(uri);