javafx change css at runtime
Is it possible to change css for a JavaFX application while it is running? The effect I am looking for is changing skins or themes at the click of a button. The UI is in an FXML file if that makes any difference. I have tried Scene.getStylesheets() .add(getClass().getResource(skinFileName).toExternalForm()); which has no effect. thanks It should have the effect. Try this full demo code: public class CssThemeDemo extends Application { private String theme1Url = getClass().getResource("theme1.css").toExternalForm(); private String theme2Url = getClass().getResource("theme2.css").toExternalForm()