I have two JPMS modules:
In module-a, I have something like:
public class MyAppplication extends Application {
....
public static void addCss(String path) {
stage.getScene().getStylesheets().add(path);
}
}
In module-b, I have a CSS file that I want to add to MyApplication
. How to do this in code in module-b? I can’t figure out how to get from another module.
I mean in the -b module:
...
MyApplication.addCss(???);
...
EDIT
In OSGi, I used the following solution in bundle-b
(assuming module-a was bundle-a and module-b was bundle-b):
String pathInBundleB = "com/foo/package-in-bundle-b/file.css"
Bundle bundleB = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle();
URL cssFileUrl = bundleB.getEntry(pathInBundleB);
MyApplication.addCss(cssFileUrl.toString());
source
share