在 javafx 2.0 中设计 GUI 的最佳方法是什么?
在 javafx 2.0 中,可以使用 FXML 方法或使用普通的 java 代码来创建布局。 对于一组精心设计的 UI 来说,最好的方法是什么?在我的应用程序中有大约 100 个子 UI。
谢谢
In javafx 2.0 it is possible to create the layout by using FXML approach or by using normal java code.
What is the best way with respect to a well designed set of UIs. In my application there is about 100 sub UIs.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
FXForm2 是一个提供自动 JavaFX 2.0 表单生成的库。
但是 FXForm2 并不是完整的所见即所得 GUI 设计工具。
http://dooapp.github.io/FXForm2/
FXForm2 is a library providing automatic JavaFX 2.0 form generation.
however FXForm2 is not full WYSIWYG GUI design tool.
http://dooapp.github.io/FXForm2/
场景构建器应该是创建应用程序的独特 UI 的良好起点。考虑到您有数百个 UI,我认为它们的某些“外观”应该相同,但功能略有不同。您可以动态加载 FXML 并在运行时分配控制器。这意味着 1 个 FXML 文件可以与多个控制器一起使用。这可以节省您一些时间,同时保持代码动态以便于维护。
因此,要在不同的控制器上使用相同的 FXML。
希望这有帮助。
Scene builder should be a good starting point to create unique UIs of your application. Considering you have 100s of UIs, I assume that some of their "appearances" should be identical with slightly different functions. You can load the FXML dynamically and assign controller at run time. Which means 1 FXML file can be used with multiple controllers. Which can save you some time while keeping the code dynamic for easier maintenance.
So, to make use of the same FXML with a different controller.
Hope this helps.
仅供参考,
Java fx http://javafx.com/roadmap/ 的路线图显示场景构建器将是于年中左右发布。从上面的网页:
“JavaFX Scene Builder 是一个所见即所得的 GUI 设计工具,用于
JavaFX 平台。它可以通过简单地设计用户界面屏幕
将 GUI 组件从调色板拖放到场景上。
该工具生成可在项目中使用的 FXML 格式2文件
在任何 IDE(例如 NetBeans 或 Eclipse)中。 JavaFX 场景生成器可以是
用于为在浏览器中运行的桌面应用程序和小程序创建 GUI。”
fyi,
road map for Java fx http://javafx.com/roadmap/ shows that the scene builder will be released around middle of the year. From the above web page:
"JavaFX Scene Builder is a WYSIWYG GUI design tool for the
JavaFX platform. It enables designing user interface screens by simply
dragging and positioning GUI components from a palette onto a scene.
The tool generates files in FXML format2 that can be used within a project
in any IDE such as NetBeans or Eclipse. The JavaFX Scene Builder can be
used to create GUI for desktop applications and applets that run in a browser."
对于此目的,FXML 看起来更合乎逻辑。通过使用 FXML,
FXML looks more logical for that purpose. By using FXML
在此处获取 JavaFX Scenebuilder。
Get JavaFX Scenebuilder here.