Java GUI 替代品

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1391590/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 16:23:53  来源:igfitidea点击:

Java GUI alternatives

javauser-interfaceswing

提问by Jeff Storey

I write applications in Java, and I'm looking for ways to speedup GUI programming. Binding frameworks help, but the particular application I'm working on now wouldn't benefit too much from that (it doesn't display a lot of data, just a lot of ways to manipulate the data). I feel like I spend way too much time writing boiler-plate GUI code, like adding action listeners, laying out components, etc. While I'm not a C# developer, I've heard XAML works very well and have seen JAXX, which appears to be similar to XAML. I'm also looking at the Groovy Swing Builder. It just seems like there are so many options, maybe even too many.

我用 Java 编写应用程序,我正在寻找加速 GUI 编程的方法。绑定框架有所帮助,但我现在正在处理的特定应用程序不会从中受益太多(它不会显示大量数据,只是提供了大量操作数据的方法)。我觉得我花了太多时间编写样板 GUI 代码,比如添加动作侦听器、布置组件等。虽然我不是 C# 开发人员,但我听说 XAML 工作得很好,并且见过 JAXX,它似乎类似于 XAML。我也在研究 Groovy Swing Builder。似乎有很多选择,甚至可能太多了。

Can anyone share their thoughts on alternatives to hand writing simple Java UI code?

任何人都可以分享他们对手写简单 Java UI 代码的替代方法的想法吗?

Also, I'd be interested in discussing how to migrate existing Java Swing code to use some of these options.

此外,我对讨论如何迁移现有 Java Swing 代码以使用其中一些选项很感兴趣。

thanks, Jeff

谢谢,杰夫

采纳答案by Dónal

Griffonis a Groovy framework for creating Java desktop applications. Admittedly, if you don't already know Groovy, you'll need to learn (some parts of) a new language to use it effectively, but the enhanced productivity is worth the effort in my opinion.

Griffon是一个用于创建 Java 桌面应用程序的 Groovy 框架。诚然,如果您还不了解 Groovy,您需要学习(某些部分)一门新语言才能有效地使用它,但在我看来,提高生产力是值得的。

回答by xrath

How about using MiGLayout?

使用MiGLayout怎么

It is extremely simple to learn and use. I strongly recommend it to you. In my last project, it helped me to reduce much time to implement lots of GUI.

它非常易于学习和使用。我强烈推荐给你。在我的上一个项目中,它帮助我减少了很多时间来实现大量的 GUI。

回答by John O

Layouts:

布局:

For layouts, I have abandoned the JDK Layout Managers in favor of the JGoodies Formstool. I find it much more effective. It reads at a higher level, and reduces significantly the amount of code related to layouts.

对于布局,我已经放弃了 JDK 布局管理器,转而使用JGoodies Forms工具。我觉得它更有效。它在更高的层次上读取,并显着减少了与布局相关的代码量。

回答by Timothy Pratley

I recommend using ClojureIt allows you to write Java GUIs quickly without the boilerplate.

我推荐使用Clojure它允许您在没有样板的情况下快速编写 Java GUI。

回答by OscarRyz

You should definitely use an IDE with GUI builder.

您绝对应该使用带有 GUI 构建器的 IDE。

IntelliJ IDEAand NetBeanshave very good GUI builders, they allow you to automatically bind objects and would reduce tremendously the amount of effort needed to create a GUI as opposed of doing it completely by hand.

IntelliJ IDEANetBeans具有非常好的 GUI 构建器,它们允许您自动绑定对象,并且将大大减少创建 GUI 所需的工作量,而不是完全手动完成。

回答by CarlG

I agree with others that tying down to NetBeans seems dangerous - especially when working with other developers. I've used the (commercial) Swing Designer (by "instantiations") plugin for Eclipse with quite a lot of success - the thing I like about it is that it round-trips, generating code that you are free to alter by hand. Not perfect, but a good time-saver.

我同意其他人的看法,即绑定到 NetBeans 似乎很危险——尤其是在与其他开发人员合作时。我已经为 Eclipse 使用了(商业)Swing Designer(通过“实例化”)插件并取得了相当大的成功 - 我喜欢它的一点是它可以往返,生成您可以手动更改的代码。不完美,但可以节省时间。

But the biggest difference in my Swing programming came with the discovery of better layout managers. I went from FormLayout (good), to TableLayout (better), but now I don't use anything but MiGLayout (incredible).

但我的 Swing 编程最大的不同在于发现了更好的布局管理器。我从 FormLayout(好)到 TableLayout(更好),但现在我除了 MiGLayout 什么都不用(难以置信)。

回答by u1154142

You can try ZK(the best open source Java framework for building enterprise web and mobile apps). http://www.zkoss.org/

您可以尝试 ZK(用于构建企业 Web 和移动应用程序的最佳开源 Java 框架)。 http://www.zkoss.org/

回答by tim_wonil

I'm no expert in GUI programming, but have you tried using NetBeans as a platformfor your app?

我不是 GUI 编程方面的专家,但是您是否尝试过使用NetBeans 作为应用程序的平台