JavaFX 2 vs Swing用于纯Windows桌面应用程序 [英] JavaFX 2 vs Swing for a pure Windows desktop app

查看:184
本文介绍了JavaFX 2 vs Swing用于纯Windows桌面应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写一个桌面应用程序,因为我开始使用Swing已经有一段时间了,因此将使用这两种技术进行学习。

I need to write a desktop app and its been a while since I started used Swing so will have a learning curve with either technology.

是否有任何优势使用JavaFX 2做我的应用程序?

Are there any advantages in doing my app using JavaFX 2?

推荐答案

4年前我有同样的问题并得出结论我会成为最好使用Swing,因为很多第三方库在那些日子里仍然为Swing编写。另外来自Sun的1.0版本通常有点粗糙(我在JSF 1.0和JPA 1.0上烧掉了自己: - )。

4 Years back I was having the same question and came to the conclusion that I would be best of using Swing since a lot of third party libraries were still written for Swing in those days. Also 1.0 releases from Sun were usually a bit rough around the edges (I burned myself on JSF 1.0 and JPA 1.0 :-).

今天很多库都有JavaFX对应物或者作为JavaFX库提供。也就是说,还有很多图书馆仍然是Swing独家。我也用JavaFX 2.0做了一些小事,看起来真的很完整。我没有碰到任何showstoppers。

Today a lot of libraries have JavaFX counterparts or are available as JavaFX library. That said there are also a lot of libraries wich are still Swing exclusive. Also I've done some small things with JavaFX 2.0 and it seems really complete. I haven't bumped into any showstoppers.

你需要检查除了Swing / JavaFX(以及哪一个)之外你将使用多少个外部UI库。如果答案不是很多或很多都有Java FX替代品(或者很容易自己),我肯定会选择JavaFX。您还可以在JavaFX中使用Swing组件。

You need to check how many external UI libraries you are going to use besides Swing / JavaFX (and which one). If the answer is not many or a lot have a Java FX alternative (or are simple to todo yourself) I would definitly go for JavaFX. Also you can still use Swing components in JavaFX.

如前所述,JavaFX将来会弃用Swing,Oracle似乎也会在JavaFX上做出承诺(它也将是开源的)。所以我强烈推荐JavaFX。

As stated JavaFX is going to deprecate Swing in the future and Oracle seems committed on JavaFX (it also going to be opensourced). So I would highly recommend JavaFX.

状态更新2014年4月13日:

如果你在2年后不相信:JavaFX现在看起来确实如此。虽然Swing可能会存在很长一段时间,但它目前处于维护模式。将大型应用程序(如IntellIJ或Netbeans)完全移植到JavaFX需要花费很多精力。对于那些大型应用程序来说,这样一个大型端口目前可能不值得。

In case you weren't convinced 2 years back: JavaFX now definitely looks like the way to go. Though Swing will probably around for a long time it is currently in maintenance mode. It will take a lot of effort to port large applications (like IntellIJ or Netbeans) completely to JavaFX. And for those large applications such a large scale port is probably not worthwhile at the moment.

这篇关于JavaFX 2 vs Swing用于纯Windows桌面应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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