Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在这里链接 我发现“使用 JavaFX CSS 为 UI 设置皮肤使您能够将图 1 中所示的 UI 更改为图 2 中所示的 UI,只需更改使用的样式表。”,但在编译我的项目后,我找不到任何 css 文件在 dist 文件夹中。
所以我的问题是:是否可以在不重新编译应用程序的情况下更改样式以及如何完成?
有下一个选项:
将 css 文件放在 Web 服务器上并使用如下链接:
scene.getStylesheets().add("http://myhost.com/style.css");
或者
scene.getStylesheets().add("file:///E:/style.css");
向设计人员解释如何使用 jdk 中的任何存档管理器或 jar 实用程序更新 css 文件:
jar uf FXApp.jar style.css