I have a JavaFx OSGi project:
src
main.java.ui.impl
UI.java
main.resources
ui.css
I'm getting a null pointer whene I try to link up the Scene to the CSS file ui.css as follows:
scene.getStylesheets().add(this.getClass().getResource("../../../ui.css").toExternalForm());
I've even tried to have the ui.css in the folder/ package ui directly above the package impl where UI.java is located, but still null pointer
scene.getStylesheets().add(this.getClass().getResource("../ui.css").toExternalForm());
It only works where all the files are placed in the same package:
scene.getStylesheets().add(this.getClass().getResource("ui.css").toExternalForm());
What is the right way to go about this? What am I doing wrong?
Thank you all in advance.
UPDATE
Source repository on GitHub >>> javafx-osgi-example-master
Be sure to first install Amdatu from the Eclipse marketplace