java - JavaFx resources (css) and OSGi -


i have osgi (felix) javafx application. when launch application get:

may 30, 2015 10:44:59 pm com.sun.javafx.css.stylemanager loadstylesheetunprivileged warning: resource "com/sun/javafx/scene/control/skin/modena/modena.css" not found. may 30, 2015 10:44:59 pm com.sun.javafx.css.stylemanager loadstylesheetunprivileged warning: resource "com/sun/javafx/scene/control/skin/modena/modena.css" not found. 

and stages without css rules (nor borders etc). solution found is

bundle systembundle =frameworkutil.getbundle(myapplication.class).getbundlecontext().getbundle(0); url url0=systembundle.getresource("com/sun/javafx/scene/control/skin/modena/modena.css"); url url1=systembundle.getresource("com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css"); scene.getstylesheets().add(url0.tostring()); scene.getstylesheets().add(url1.tostring()); 

however it's bad solution , besides need every stage. better solution solve problem?

i found answer. necessary add packages import section of manifest.mf. use maven done via maven-bundle-plugin

<plugin>    <groupid>org.apache.felix</groupid>    <artifactid>maven-bundle-plugin</artifactid>    <version>2.3.7</version>    <extensions>true</extensions>    <configuration>        <instructions>          <import-package>com.sun.javafx.scene.control.skin.modena,*</import-package>        </instructions>    </configuration> </plugin> 

the important asterisk sign @ end. necessary in order add auto detected packages bundle needs. if omit sign have add packages manually.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -