Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Conflict between SceneBuilder and StyleManager with stylesheet url

630114Dec 21 2012 — edited Dec 21 2012
When referencing a style sheet within the fxml from the root of the classpath as follows:

<stylesheets>
<URL value="@/app/scenes/app.css" />
</stylesheets>

The StyleManager can load it when the fxml loader loads it. But the SceneBuilder 1.1 preview throws an IllegalStateException when trying to open the .fxml file.

When adding the stylesheet with the SceneBuilder it adds the relative link to the stylesheet as follows:

<stylesheets>
<URL value="@../app.css" />
</stylesheets>

When loading the css file during the fxml load, the StyleManager throws an exception that the stylesheet cannot be found. The development is being done in netbeans 7.2 which builds a jar for the app and the stylesheet is being loaded from the jar:

INFO: com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged Could not find stylesheet: jar:file:/C:/Dev/stuff/app/dist/App.jar!/app.css

so it is trying to load it relative from the root of jar classpath rather than relative to the fxml files location.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2013
Added on Dec 21 2012
2 comments
769 views