更新 CSS 样式表而不重新编译 JavaFX 2 项目

发布于 2024-12-18 10:41:54 字数 265 浏览 2 评论 0原文

这里链接 我发现“使用 JavaFX CSS 为您的 UI 换肤,只需更改所使用的样式表,您就可以将图 1 中所示的 UI 更改为图 2 中所示的 UI。”,但是编译我的项目后,我在 dist 中找不到任何 css 文件文件夹。

所以我的问题:是否可以在不重新编译应用程序的情况下更改样式?如何做到?

Here link
I found that "Skinning your UI with JavaFX CSS enables you to change the UI shown in Figure 1 to the UI shown in Figure 2 just by changing the style sheet used.", but after compiling my project I cannot find any css files in dist folder.

So my question: is it possible to change style without recompiling app and how can it be done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

薄荷梦 2024-12-25 10:41:54

还有以下选项:

  1. 将 css 文件放在 Web 服务器上并使用如下链接:

    scene.getStylesheets().add("http://myhost.com/style.css");
    

    scene.getStylesheets().add("file:///E:/​​style.css");
    
  2. 向设计人员解释如何使用 jdk 中的任何存档管理器或 jar 实用程序更新 css 文件:

    jar uf FXApp.jar style.css
    

There are next options:

  1. Put css files on web server and use links like:

    scene.getStylesheets().add("http://myhost.com/style.css");
    

    or

    scene.getStylesheets().add("file:///E:/style.css");
    
  2. Explain to designers how to update css files using any archive manager or jar utility from jdk:

    jar uf FXApp.jar style.css
    
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文