ihazgum ihazgum - 4 years ago 147
CSS Question

JavaFx Stylesheet in the same folder Not found

My Project TreeView is like this:

project
- src
-package
-javafx.java, style.css

I tried this piece of code as well as just directly putting in style.css

scene.getStylesheets().add("../src/package/style.css");

Answer Source

Try do it this way:

    scene.getStylesheets().add(getClass().getResource("style.css").toExternalForm());
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download