Whose damn idea was to exclude the StyleManager without a direct and clear replacement - it crashed many programs, as I see it!
I need to do some restyling for the whole application (custom components, custom pseudo classes, custom patches for the platform, etc.). In JavaFX 8, I could use: com.sun.javafx.css.StyleManager.getInstance().addUserAgentStylesheet("MyShit.css");
But in Java 9, StyleManager is not available. So, is there a way to set CSS for each scene?
Using "Application.setUserAgentStylesheet" is not an option, because I do not want to lose the standard lookandfeel, and I already call it to set the MODENA style. I want to extend the default CSS so as not to replace it. And I also do not want to rewrite the entire MODENA (obviously).
And I really do not want to set the same stylesheet for each form / scene in the application manually (or add it to each FXML file). There are many forms of dynamically constructed dialogs. And the main reason, there are parts (and libraries) that are shared between several applications, so I donβt want to hardcode the stylesheets (which can have different names and paths for different applications).
So, I need a way to set an additional stylesheet for each possible application scene at one point in the program. Is this possible in the FX9?
PS I looked at custom FXML loaders, CSS loaders, scene loaders and other ways to intercept scene creation - there is no way!
source share