Creating a scene, setting the stylesheet, and setting the scene in the stage works, but when I create another scene, set the stylesheet, and set the scene in the stage again the CSS styling stops working.
This is how I set the stylesheet:
scene.getStylesheets().add("/stylesheets/main.css");
This is how I set the scene:
stage.setScene(scene);
stage.setVisible(true);
I have a simple application that has a splash screen and then it transitions to a primary dashboard. The splash screen shows up with proper styling (based on the CSS), but when I change the scene to the dashboard the CSS settings are not applied and everything appears unstyled. If i change the order in which the scenes are displayed (Dashboard before Splash screen) then the Dashboard shows up properly, but the Splash screen does not.
This is how I set the stylesheet:
scene.getStylesheets().add("/stylesheets/main.css");
This is how I set the scene:
stage.setScene(scene);
stage.setVisible(true);
I have a simple application that has a splash screen and then it transitions to a primary dashboard. The splash screen shows up with proper styling (based on the CSS), but when I change the scene to the dashboard the CSS settings are not applied and everything appears unstyled. If i change the order in which the scenes are displayed (Dashboard before Splash screen) then the Dashboard shows up properly, but the Splash screen does not.