As I work on subclassing various JavaFX 2 classes for a library that will be utilized by others, I am facing the challenge of applying a stylesheet (included in the library) to all instances of MySceneClass. Despite my efforts, I have been struggling with the correct path configuration. I have experimented with different variations such as:
mySceneInstance.getStylesheets.addAll("/com/mine/css/MySceneClass.css")
The package com.mine.css contains the stylesheet within the library. I have attempted alternatives like removing the leading slash and adjusting the path accordingly, but each time I encounter the following message:
WARNING: com.sun.javafx.css.StyleManager loadStylesheet Resource "/com/mine/css/MySceneClass.css" not found.
I also attempted adding a dummy Css class to the css package and using:
com.mine.css.Css.getResource("Scene.css")
To obtain the URL required for ...getStyleSheets.addAll(...), yet this resulted in a confusing message:
WARNING: com.sun.javafx.css.StyleManager loadStylesheet Resource "../css/Scene.css" not found.
Despite getResource correctly identifying the file, I am still unable to load it. These issues are occurring within the current OS X dev preview (likely version 2.1 09).
If anyone could provide assistance, I would greatly appreciate it.