Language: JavaFX
IDE: Netbeans
Problem: I\'m trying to add a css file to the stylesheet, but the first line of the following code always generates a Nu
I had the same problem (in NetBeans 8). I found a solution here : https://blog.idrsolutions.com/2014/04/use-external-css-files-javafx/
My resource file spreadsheet.css was here :
MyApp
-resources
--spreadsheet.css
-source packages
--fr.ccc.myapp.view
---mainView.java
---FXMLMain.fxml
In mainView.java :
File f = new File("resources/spreadsheet.css");
spreadsheet.getStylesheets().add("file:///" + f.getAbsolutePath().replace("\\", "/"));
Hope this helps.