Dynamically add CSS stylesheets in JavaFX

前端 未结 5 694
我寻月下人不归
我寻月下人不归 2021-01-05 11:08

I would like to add a CSS file which is located somewhere on the filesystem. The purpose is to write an application where the user can add JavaFX CSS files (which are create

5条回答
  •  离开以前
    2021-01-05 11:27

    If css in same packaage simply use

    scene.getStylesheets().add(getClass().getResource("style.css").toExternalForm());
    

提交回复
热议问题