现在选择哪个Java GUI框架? [英] Which Java GUI framework to choose now?

查看:577
本文介绍了现在选择哪个Java GUI框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果要现在或在不久的将来启动新项目,您会选择哪个GUI框架/库?

Which GUI framework/library would you choose if you were to start your new project now or in the near future?

它具有可以免费用于商业和跨平台使用。

It has to be free for commercial use and cross platform.

我一直是一个很高兴的秋千用户,但是Sun似乎在推动 swing 弃用,而推动 Javafx ,这还没准备好。

I have been a happy swing user, but Sun seems like pushing swing to deprecation, while pushing Javafx, which is not yet ready for prime time.

还有 SWT ,但是看起来在Linux上有问题。

There's also SWT, but it seems like it has issues on Linux.

您选择的Gui库/框架是什么?

What is your Gui library/framework of choice?

编辑:Sun已取消 swingx 项目。在论坛上,关于 http://swingx.dev.java.net 的评论似乎是大多数Sun资源,

Sun has canceled swingx project. From the forum comments on http://swingx.dev.java.net seems like majority of Sun resources that previously worked on core swing are now developing JavaFx full time.

推荐答案

我认为,尽管Sun的管理不善,Swing仍然是一个出色的框架。您可以使用它来执行 lot ,特别是如果该 lot涉及自定义呈现的UI控件时,尤其如此。如果您的应用程序需要品牌LAF,或什至只是几个复杂的自定义控件,Swing正是您想要的。

I think that despite Sun's mismanagement, Swing is still an excellent framework. You can do a lot with it, especially if that "lot" involves custom rendered UI controls. If your application needs a branded LAF, or even just a few complex custom controls here and there, Swing is exactly what you want.

在硬币的另一面,我非常喜欢SWT。这是一个不好的说唱,因为每个人以前都认为这是IBM接管Java的策略,但这实际上只是另一个与Swing互补的UI框架。我不建议使用SWT进行超级复杂的图形渲染(特别是:合成)或创建真正不平凡的自定义控件,但对于其他所有方面,它确实非常花哨。由于依赖于位掩码和用户管理的事件分发循环之类的东西,API本身受到了很多批评,但是一旦您习惯了它们,其中的大多数事情都是相当透明的。组件本身比Swing的组件简单得多(就可扩展性和类似性而言),这意味着API可以按比例简化。我实际上还记得如何在SWT中创建和填充表。但是我认为在没有Google协助的情况下,我没有 在Swing中处理过。

On the other side of the coin, I do like SWT quite a lot. It gets a bad rap because everyone used to think it was IBM's ploy to take over Java, but it's really just another UI framework that is quite complementary to Swing. I would not advise using SWT for super-complex graphics rendering (specifically: compositing) or for creating really non-trivial custom controls, but for everything else it is really dandy. The API itself gets a lot of criticism because of things like reliance on bit masks and a user-managed event dispatch loop, but most of those things are pretty transparent once you get used to them. The components themselves are a lot simpler than Swing's (in terms of extensibility and similar), which means that the API can be proportionally simpler. I can actually remember how to create and populate a table in SWT; whereas I don't think I have ever handled that in Swing without Google's assistance.

SWT现在最大的问题是稳定版本取决于在Mac OS X上为Carbon。这意味着SWT应用只能在Java 5上运行32位(或在SoyLatte上运行32位)。对于其他平台,SWT在Windows(Vista和XP)上非常出色,在GTK Linux上几乎一样。我(最近几年)在Linux上的SWT上还没有任何问题,所以让您将其作为痛点而感到惊讶。

SWT's biggest problem right now is the stable version depends on Carbon on Mac OS X. This means that SWT apps can only run 32bit on Java 5 (or 32bit on SoyLatte). As for other platforms, SWT is phenomenal on Windows (Vista and XP) and almost as good on GTK Linux. I have not (in recent past) had any issues with SWT on Linux, so I'm a bit surprised that you would mention it as a sore point.

回来您的问题:这完全取决于您的应用程序需求。如果它是一个带有大量自定义控件和复杂合成功能的华丽的自定义样式应用程序,那么Swing是该镇唯一的游戏。但是,如果更简单的API对您而言更重要,或者您的用户需要平台LAF保真度最高,则SWT是最佳选择。

Coming back to your question: it all depends on what your application needs. If it's a flashy custom-styled application with tons of custom controls and complex compositing, Swing is the only game in town. However, if a simpler API is more important to you, or if your users demand the ultimate in platform LAF fidelity, SWT is the best choice.

这篇关于现在选择哪个Java GUI框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆