Open MBecM opened 6 years ago
I want to add global.css file directly into Scene, but scene is not available before launch. My first attempt was to override beforeInitialView() method but scene is still not initialized.
global.css
Scene
beforeInitialView()
public void beforeInitialView(Stage stage, ConfigurableApplicationContext ctx) { super.beforeInitialView(stage, ctx); stage.getScene().getStylesheets().addAll(getClass().getResource("global.css").toExternalForm()); } public static void main(String[] args) { launch(Main.class, MainView.class, args); }
I can set global.css in main.fxml, but this force me to set global.css in every possible root view in scene.
main.fxml
Not sure yet, if I get you right... Need to check it.
I want to add
global.css
file directly intoScene
, but scene is not available before launch. My first attempt was to overridebeforeInitialView()
method but scene is still not initialized.I can set
global.css
inmain.fxml
, but this force me to setglobal.css
in every possible root view in scene.