Java GUI框架。选择什么?Swing, SWT, AWT, SwingX, JGoodies, JavaFX, Apache Pivot?

时间:2021-10-27 11:31:18

There is quite a lot of gui frameworks out there for java, but what is recognized as today's framework of choice?

在java中有很多gui框架,但是什么是公认的今天的选择框架呢?

The following is my understanding of the different frameworks, please correct me if im wrong. This is a very loosely defined set of questions, but i still think its valuable for anyone thinking of creating rich gui applications.

以下是我对不同框架的理解,如果我错了请纠正我。这是一个非常宽泛的问题集,但我仍然认为它对任何想要创建富gui应用程序的人来说都是有价值的。


AWT

AWT

Is the very foundation of swing, it performs well but is lacking in advanced components. If you intend to create rich applications, AWT is probably not the way to go. However for smaller gui applications that doesn't require rich user interfaces. This might suit perfectly as it's a tried and proven framework.

是swing的基础,它表现良好,但缺乏高级组件。如果您打算创建富应用程序,那么AWT可能不是解决方法。但是对于不需要富用户界面的小型gui应用程序来说。这可能非常适合,因为它是一个经过验证的框架。


Swing

摇摆不定的

Based on AWT as previously stated. In its infancy it was regarded as slow and buggy and caused IBM to create SWT for Eclipse. However with Java 5 (or 6?) Swing became the framework of choice for building new applications. Swing has a lot of rich components but are still lacking in some areas. One example being that there isn't a full featured TreeTable component which can do sorting and filtering/searching.

基于AWT,如前所述。在它的婴儿期,它被认为是缓慢而有bug的,并导致IBM为Eclipse创建SWT。但是使用Java 5(或6?)Swing成为构建新应用程序的首选框架。Swing有许多丰富的组件,但在某些领域仍然缺乏。其中一个例子是,没有一个完整的可TreeTable组件可以进行排序和过滤/搜索。


SWT

SWT

Created by IBM for Eclipse, they seemed to think that Swing was not suited for Eclipse at the time. By itself is pretty low-level, and it uses the platform's native widgets through JNI. It is not related to Swing and AWT at all. Their API is however somewhat clunky and not intuitive. They do have some advanced component's like a TreeTable. (but i don't think they support sorting and filtering out of the box). SWT uses some native bindings (through JNI?) and the rant on the internet is that this framework should not be used in today's projects. (why not?)

在IBM为Eclipse创建的时候,他们似乎认为Swing在当时并不适合Eclipse。它本身是相当低级的,它通过JNI使用平台的原生部件。它与Swing和AWT无关。然而,他们的API有些笨拙,不太直观。它们确实有一些高级的组件,比如树状结构。(但我不认为它们支持排序和过滤)。SWT使用一些本机绑定(通过JNI?),而在internet上的咆哮是这个框架不应该在今天的项目中使用。(为什么不呢?)


SwingX

SwingX

Based on Swing and it's mission is to create rich components for swing. Still under development. (not very active though.) Have a very nice set of components, like for example TreeTable. But the TreeTable does not support filtering and sorting as far as i know. It does however support searching with highlighting.

基于Swing,它的任务是为Swing创建丰富的组件。仍在发展。(虽然不是非常活跃。)有一组很好的组件,比如TreeTable。但据我所知,TreeTable不支持过滤和排序。但它确实支持搜索高亮显示。

Note that SwingX is components (AFAIU) that are extensions or compositions of existing Swing components

请注意SwingX是组件(AFAIU),它是现有Swing组件的扩展或组合。


JGoodies

JGoodies

A framework which i know nothing about... What is it's strengths and weaknesses? What set's Jgoodies apart from the rest?

一个我一无所知的框架…它的优点和缺点是什么?除了剩下的,还有什么东西是固定的?

JGoodies OTOH is about PLAFs and layouts.

JGoodies OTOH是关于PLAFs和布局的。


JavaFX

JavaFX

The latest flagship of Java/Oracle. promising to be the facto standard in developing rich desktop or web applications.

Java/Oracle的最新旗舰。承诺成为开发富桌面或web应用程序的实际标准。


Apache Pivot

Apache主

It renders UI using Java2D, thus minimizing the impact of (IMO, bloated) legacies of Swing and AWT. (@Augustus Thoo)

它使用Java2D呈现UI,从而最小化Swing和AWT的影响(IMO,臃肿的)。(@Augustus Thoo)

It's main focus seems to be on RIA (Rich internet applications), but it seems it can also be applied to desktop applications. And as a personal comment, Looks very interesting! I Especially like that it's an apache project.

它的主要关注点似乎是RIA(富internet应用程序),但它似乎也可以应用于桌面应用程序。作为个人评论,看起来很有趣!我特别喜欢它是一个apache项目。

https://cwiki.apache.org/PIVOT/frequently-asked-questions-faq.html

https://cwiki.apache.org/PIVOT/frequently-asked-questions-faq.html


Qt Jambi

Qt占碑

A java wrapper to the native qt library which is written in c/c++. Very powerful, widely used and accepted. Has a lot of GUI components and a easy to use API.

用c/c++编写的本机qt库的java包装器。非常强大,广泛使用和接受。有很多GUI组件和易于使用的API。

http://qt-jambi.org/

http://qt-jambi.org/


So, to try to summarize a bit of what im asking:

所以,试着总结一下我的问题:

Say i wanted to create a desktop application today in Java which involves a lot of advanced components, what should i choose? And why?

假设我今天想在Java中创建一个包含许多高级组件的桌面应用程序,我应该选择什么?,为什么?

Which one of these frameworks should be recognized as deprecated and which should be recognized as the frameworks of the distant future?

哪些框架应该被认为是过时的,哪些应该被认为是遥远未来的框架?

What is todays de-facto-standard framework and which tools do you utilize to create java gui applications?

您使用什么工具来创建java gui应用程序?


I might regret asking this, but ill try it anyways:

我可能会后悔问这个问题,但我会尝试一下:

C#/.Net is said to have a very good set of easy to use components which can be flexed in every direction possible. And after investigating different java frameworks to some extent i can't seem to say the same about Java. Why is this? Why doesn't java (which is the most widely used programming language in the world) have the same set of GUI components?

c# /。Net据说有一套很好的易于使用的组件,可以在任何可能的方向上进行伸缩。在研究了不同的java框架后,在某种程度上我似乎不能说java。这是为什么呢?为什么java(世界上使用最广泛的编程语言)没有相同的GUI组件集?

Is it just that java has based their gui components at a much lower level, and it is possible to write all these advanced components that im looking for, but you have to do much if not all of the work yourself?

仅仅是java在更低的层次上基于gui组件,并且可以编写我所寻找的所有这些高级组件,但是如果不是所有的工作,您都必须做很多工作吗?

9 个解决方案

#1


80  

Decision tree:

决策树:

  1. Frameworks like Qt and SWT need native DLLs. So you have to ask yourself: Are all necessary platforms supported? Can you package the native DLLs with your app?

    像Qt和SWT这样的框架需要本地dll。所以你必须问自己:所有的平台都支持吗?你能用你的应用程序包本地的dll吗?

    See here, how to do this for SWT.

    看这里,如何为SWT做这个。

    If you have a choice here, you should prefer Qt over SWT. Qt has been developed by people who understand UI and the desktop while SWT has been developed out of necessity to make Eclipse faster. It's more a performance patch for Java 1.4 than a UI framework. Without JFace, you're missing many major UI components or very important features of UI components (like filtering on tables).

    如果你有选择,你应该选择Qt / SWT。Qt是由理解UI和桌面的人开发的,而SWT已经开发出来,以使Eclipse更快。它更像是Java 1.4的性能补丁,而不是UI框架。没有JFace,您将丢失许多主要的UI组件或UI组件的非常重要的特性(如对表的过滤)。

    If SWT is missing a feature that you need, the framework is somewhat hostile to extending it. For example, you can't extend any class in it (the classes aren't final, they just throw exceptions when the package of this.getClass() isn't org.eclipse.swt and you can't add new classes in that package because it's signed).

    如果SWT丢失了您需要的特性,那么框架对扩展它有些敌意。例如,您不能在其中扩展任何类(类不是final的,它们只是抛出异常,当this.getClass()的包不是org.eclipse时)。swt和您不能在该包中添加新类,因为它已签名)。

  2. If you need a native, pure Java solution, that leaves you with the rest. Let's start with AWT, Swing, SwingX - the Swing way.

    如果您需要一个原生的纯Java解决方案,那么剩下的就交给您了。让我们从AWT, Swing, SwingX - Swing的方式开始。

    AWT is outdated. Swing is outdated (maybe less so but not much work has been done on Swing for the past 10 years). You could argue that Swing was good to begin with but we all know that code rots. And that's especially true for UIs today.

    AWT已经过时了。Swing已经过时了(在过去的10年里,Swing的工作已经完成的不多了)。你可能会说,Swing很好,但是我们都知道代码会腐烂。对于今天的UIs来说尤其如此。

    That leaves you with SwingX. After a longer period of slow progress, development has picked up again. The major drawback with Swing is that it hangs on to some old ideas which very kind of bleeding edge 15 years ago but which feel "clumsy" today. For example, the table views do support filtering and sorting but you still have to configure this. You'll have to write a lot of boiler plate code just to get a decent UI that feels modern.

    这就剩下了SwingX。经过长时间的缓慢发展,发展又重新抬头。Swing的主要缺点是,它依赖于一些旧的想法,这些想法在15年前就已经非常流行了,但是今天却显得“笨拙”。例如,表视图支持过滤和排序,但您仍然需要配置它。你必须编写大量的锅炉模板代码,才能得到一个让人感觉很现代的像样的UI。

    Another weak area is theming. As of today, there are a lot of themes around. See here for a top 10. But some are slow, some are buggy, some are incomplete. I hate it when I write a UI and users complain that something doesn't work for them because they selected an odd theme.

    另一个薄弱环节是主题。到今天为止,有很多的主题。请看这里的前10名。但是有些是缓慢的,有些是错误的,有些是不完整的。当我写UI的时候,我讨厌它,用户抱怨说有些东西不适合他们,因为他们选了一个奇怪的主题。

  3. JGoodies is another layer on top of Swing, like SwingX. It tries to make Swing more pleasant to use. The web site looks great. Let's have a look at the tutorial ... hm ... still searching ... hang on. It seems that there is no documentation on the web site at all. Google to the rescue. Nope, no useful tutorials at all.

    JGoodies是Swing顶部的另一层,比如SwingX。它试图使Swing使用起来更愉快。这个网站看起来很棒。让我们看一看教程…嗯……仍然搜索…坚持下去。看起来网站上根本没有文档。谷歌的救援。没有,没有有用的教程。

    I'm not feeling confident with a UI framework that tries so hard to hide the documentation from potential new fans. That doesn't mean JGoodies is bad; I just couldn't find anything good to say about it but that it looks nice.

    我对一个试图将文档从潜在的新粉丝中隐藏起来的UI框架感到不太自信。这并不意味着JGoodies是坏的;我只是觉得没什么好说的,不过看起来不错。

  4. JavaFX. Great, stylish. Support is there but I feel it's more of a shiny toy than a serious UI framework. This feeling roots in the lack of complex UI components like tree tables. There is a webkit-based component to display HTML.

    JavaFX。很好,时尚。支持是存在的,但我觉得它更像是一个闪亮的玩具,而不是一个严肃的UI框架。这种感觉源于缺少复杂的UI组件,比如树表。有一个基于webkit的组件来显示HTML。

    When it was introduced, my first thought was "five years too late." If your aim is a nice app for phones or web sites, good. If your aim is professional desktop application, make sure it delivers what you need.

    当它被介绍的时候,我的第一个想法是“五年太迟了”。如果你的目标是一个很好的手机或网站应用程序,很好。如果你的目标是专业的桌面应用程序,确保它提供你所需要的。

  5. Pivot. First time I heard about it. It's basically a new UI framework based on Java2D. So I gave it a try yesterday. No Swing, just tiny bit of AWT (new Font(...)).

    主。我第一次听说这件事。它基本上是基于Java2D的一个新的UI框架。所以我昨天试了一下。没有秋千,只有很小的AWT(新字体(…))。

    My first impression was a nice one. There is an extensive documentation that helps you getting started. Most of the examples come with live demos (Note: You must have Java enabled in your web browser; this is a security risk) in the web page, so you can see the code and the resulting application side by side.

    我的第一印象很好。有大量的文档可以帮助您入门。大多数示例都带有实时演示(注意:您必须在web浏览器中启用Java;这是web页面中的安全风险,因此您可以看到代码和生成的应用程序。

    In my experience, more effort goes into code than into documentation. By looking at the Pivot docs, a lot of effort must have went into the code. Note that there is currently a bug which prevents some of the examples to work (PIVOT-858) in your browser.

    在我的经验中,更多的精力放在代码而不是文档中。通过查看Pivot文档,很多工作都必须投入到代码中。请注意,目前存在一个bug,它阻止了您的浏览器中的一些示例工作(PIVOT-858)。

    My second impression of Pivot is that it's easy to use. When I ran into a problem, I could usually solve it quickly by looking at an example. I'm missing a reference of all the styles which each component supports, though.

    我对Pivot的第二个印象是它很容易使用。当我遇到一个问题时,我通常可以通过看一个例子来快速解决它。不过,我忽略了每个组件支持的所有样式的引用。

    As with JavaFX, it's missing some higher level components like a tree table component (PIVOT-306). I didn't try lazy loading with the table view. My impression is that if the underlying model uses lazy loading, then that's enough.

    与JavaFX一样,它缺少一些更高级别的组件,比如树表组件(PIVOT-306)。我没有尝试用表视图来加载延迟加载。我的印象是,如果底层模型使用惰性加载,那就足够了。

    Promising. If you can, give it a try.

    有前途。如果可以的话,试一试。

#2


13  

SWT by itself is pretty low-level, and it uses the platform's native widgets through JNI. It is not related to Swing and AWT at all. The Eclipse IDE and all Eclipse-based Rich Client Applications, like the Vuze BitTorrent client, are built using SWT. Also, if you are developing Eclipse plugins, you will typically use SWT.
I have been developing Eclipse-based applications and plugins for almost 5 years now, so I'm clearly biased. However, I also have extensive experience in working with SWT and the JFace UI toolkit, which is built on top of it. I have found JFace to be very rich and powerful; in some cases it might even be the main reason for choosing SWT. It enables you to whip up a working UI quite quickly, as long as it is IDE-like (with tables, trees, native controls, etc). Of course you can integrate your custom controls as well, but that takes some extra effort.

SWT本身是相当低级的,它通过JNI使用平台的原生部件。它与Swing和AWT无关。Eclipse IDE和所有基于Eclipse的富客户机应用程序(比如Vuze BitTorrent客户端)都是使用SWT构建的。另外,如果您正在开发Eclipse插件,通常会使用SWT。我已经开发基于eclipse的应用程序和插件已经有5年了,所以我显然有偏见。但是,我在SWT和JFace UI工具包的工作方面也有丰富的经验,它是建立在它之上的。我发现JFace非常有钱有势;在某些情况下,它甚至可能是选择SWT的主要原因。它使您能够快速地启动一个工作UI,只要它是理想的(有表、树、本机控件等)。当然,您也可以集成您的自定义控件,但这需要额外的努力。

#3


11  

I would like to suggest another framework: Apache Pivot http://pivot.apache.org/.

我想建议另一个框架:Apache Pivot http://pivot.apache.org/。

I tried it briefly and was impressed by what it can offer as an RIA (Rich Internet Application) framework ala Flash.

我做了简短的尝试,并对它作为RIA(丰富的Internet应用程序)框架所能提供的东西印象深刻。

It renders UI using Java2D, thus minimizing the impact of (IMO, bloated) legacies of Swing and AWT.

它使用Java2D呈现UI,从而最小化Swing和AWT的影响(IMO,臃肿的)。

#4


9  

Swing + SwingX + Miglayout is my combination of choice. Miglayout is so much simpler than Swings perceived 200 different layout managers and much more powerful. Also, it provides you with the ability to "debug" your layouts, which is especially handy when creating complex layouts.

Swing + SwingX + Miglayout是我选择的组合。Miglayout比200个不同的布局管理器要简单得多,而且功能更强大。此外,它还为您提供了“调试”您的布局的能力,这在创建复杂的布局时特别有用。

#5


9  

Another option is to use Qt Jambi. It has nearly all the greatness of Qt (many components, good documentation, easy to use), without the hassle of C++. I used it 3-4 years ago for a small project, even then it was almost mature.

另一种选择是使用Qt Jambi。它几乎拥有Qt的所有优点(许多组件,良好的文档,易于使用),没有c++的麻烦。3-4年前,我用它做了一个小项目,当时它几乎已经成熟了。

You might want to see the discussion about Swing vs. Qt here.

您可能希望看到关于Swing和Qt的讨论。

#6


5  

My personal opinion: Go for Swing together with the NetBeans platform.

我个人的观点是:和NetBeans平台一起去玩秋千。

If you need advanced components (more than NetBeans offers) you can easily integrate SwingX without problems (or JGoodies) as the NetBeans platform is completely based on Swing.

如果您需要高级组件(超过NetBeans提供的),您可以很容易地将SwingX集成到没有问题(或JGoodies)的情况下,因为NetBeans平台完全基于Swing。

I would not start a large desktop application (or one that is going to be large) without a good platform that is build upon the underlying UI framework.

如果没有构建在底层UI框架上的良好平台,我就不会启动一个大型的桌面应用程序(或者一个大型的桌面应用程序)。

The other option is SWT together with the Eclipse RCP, but it's harder (though not impossible) to integrate "pure" Swing components into such an application.

另一种选择是与Eclipse RCP一起使用SWT,但是将“纯”Swing组件集成到这样的应用程序中是比较困难的(尽管不是不可能的)。

The learning curve is a bit steep for the NetBeans platform (although I guess that's true for Eclipse as well) but there are some good books around which I would highly recommend.

对于NetBeans平台来说,学习曲线有点陡峭(虽然我想这对Eclipse来说也是如此),但是有一些不错的书籍我强烈推荐。

#7


4  

you forgot for Java Desktop Aplication based on JSR296 as built-in Swing Framework in NetBeans

您忘记了基于JSR296作为NetBeans内置Swing框架的Java桌面应用程序。

excluding AWT and JavaFX are all of your desribed frameworks are based on Swing, if you'll start with Swing then you'd be understand (clearly) for all these Swing's (Based Frameworks)

除了AWT和JavaFX之外,所有的desribed框架都是基于Swing的,如果您从Swing开始,那么对于所有这些Swing的(基于框架),您将会理解(很清楚)

ATW, SWT (Eclipse), Java Desktop Aplication(Netbeans), SwingX, JGoodies

ATW, SWT (Eclipse), Java Desktop Aplication(Netbeans), SwingX, JGoodies。

all there frameworks (I don't know something more about JGoodies) incl. JavaFX haven't long time any progress, lots of Swing's Based Frameworks are stoped, if not then without newest version

所有的框架(我不知道更多关于JGoodies的东西)。JavaFX没有任何进展,很多Swing的框架都被停止了,如果没有最新版本的话。

just my view - best of them is SwingX, but required deepest knowledge about Swing,

我的观点是,最好的是SwingX,但需要对Swing的深入了解,

Look and Feel for Swing's Based Frameworks

查看和感受Swing的框架。

#8


3  

I've been quite happy with Swing for the desktop applications I've been involved in. However, I do share your view on Swing not offering advanced components. What I've done in these cases is to go for JIDE. It's not free, but not that pricey either and it gives you a whole lot more tools under your belt. Specifically, they do offer a filterable TreeTable.

对于我参与的桌面应用程序,我非常高兴。但是,我确实同意您的观点,Swing没有提供高级组件。我在这些案例中所做的就是去JIDE。它不是免费的,但也不是很贵,它给你提供了更多的工具。具体来说,它们确实提供了一个可过滤的树。

#9


3  

I would go with Swing. For layout I would use JGoodies form layout. Its worth studying the white paper on the Form Layout here - http://www.jgoodies.com/freeware/forms/

我要去荡秋千。对于布局,我将使用JGoodies表单布局。它值得在这里研究表单布局的白皮书——http://www.jgoodies.com/freeware/forms/。

Also if you are going to start developing a huge desktop application, you will definitely need a framework. Others have pointed out the netbeans framework. I didnt like it much so wrote a new one that we now use in my company. I have put it onto sourceforge, but didnt find the time to document it much. Here's the link to browse the code:

此外,如果您打算开始开发一个巨大的桌面应用程序,您肯定需要一个框架。其他人指出了netbeans框架。我不太喜欢它,所以写了一个新的,我们现在在我的公司使用。我已经把它放在sourceforge上了,但是没有找到时间来记录它。下面是浏览代码的链接:

http://swingobj.svn.sourceforge.net/viewvc/swingobj/

http://swingobj.svn.sourceforge.net/viewvc/swingobj/

The showcase should show you how to do a simple logon actually..

这个展示应该告诉你如何做一个简单的登录。

Let me know if you have any questions on it I could help.

如果你有什么问题,请告诉我,我可以帮忙。

#1


80  

Decision tree:

决策树:

  1. Frameworks like Qt and SWT need native DLLs. So you have to ask yourself: Are all necessary platforms supported? Can you package the native DLLs with your app?

    像Qt和SWT这样的框架需要本地dll。所以你必须问自己:所有的平台都支持吗?你能用你的应用程序包本地的dll吗?

    See here, how to do this for SWT.

    看这里,如何为SWT做这个。

    If you have a choice here, you should prefer Qt over SWT. Qt has been developed by people who understand UI and the desktop while SWT has been developed out of necessity to make Eclipse faster. It's more a performance patch for Java 1.4 than a UI framework. Without JFace, you're missing many major UI components or very important features of UI components (like filtering on tables).

    如果你有选择,你应该选择Qt / SWT。Qt是由理解UI和桌面的人开发的,而SWT已经开发出来,以使Eclipse更快。它更像是Java 1.4的性能补丁,而不是UI框架。没有JFace,您将丢失许多主要的UI组件或UI组件的非常重要的特性(如对表的过滤)。

    If SWT is missing a feature that you need, the framework is somewhat hostile to extending it. For example, you can't extend any class in it (the classes aren't final, they just throw exceptions when the package of this.getClass() isn't org.eclipse.swt and you can't add new classes in that package because it's signed).

    如果SWT丢失了您需要的特性,那么框架对扩展它有些敌意。例如,您不能在其中扩展任何类(类不是final的,它们只是抛出异常,当this.getClass()的包不是org.eclipse时)。swt和您不能在该包中添加新类,因为它已签名)。

  2. If you need a native, pure Java solution, that leaves you with the rest. Let's start with AWT, Swing, SwingX - the Swing way.

    如果您需要一个原生的纯Java解决方案,那么剩下的就交给您了。让我们从AWT, Swing, SwingX - Swing的方式开始。

    AWT is outdated. Swing is outdated (maybe less so but not much work has been done on Swing for the past 10 years). You could argue that Swing was good to begin with but we all know that code rots. And that's especially true for UIs today.

    AWT已经过时了。Swing已经过时了(在过去的10年里,Swing的工作已经完成的不多了)。你可能会说,Swing很好,但是我们都知道代码会腐烂。对于今天的UIs来说尤其如此。

    That leaves you with SwingX. After a longer period of slow progress, development has picked up again. The major drawback with Swing is that it hangs on to some old ideas which very kind of bleeding edge 15 years ago but which feel "clumsy" today. For example, the table views do support filtering and sorting but you still have to configure this. You'll have to write a lot of boiler plate code just to get a decent UI that feels modern.

    这就剩下了SwingX。经过长时间的缓慢发展,发展又重新抬头。Swing的主要缺点是,它依赖于一些旧的想法,这些想法在15年前就已经非常流行了,但是今天却显得“笨拙”。例如,表视图支持过滤和排序,但您仍然需要配置它。你必须编写大量的锅炉模板代码,才能得到一个让人感觉很现代的像样的UI。

    Another weak area is theming. As of today, there are a lot of themes around. See here for a top 10. But some are slow, some are buggy, some are incomplete. I hate it when I write a UI and users complain that something doesn't work for them because they selected an odd theme.

    另一个薄弱环节是主题。到今天为止,有很多的主题。请看这里的前10名。但是有些是缓慢的,有些是错误的,有些是不完整的。当我写UI的时候,我讨厌它,用户抱怨说有些东西不适合他们,因为他们选了一个奇怪的主题。

  3. JGoodies is another layer on top of Swing, like SwingX. It tries to make Swing more pleasant to use. The web site looks great. Let's have a look at the tutorial ... hm ... still searching ... hang on. It seems that there is no documentation on the web site at all. Google to the rescue. Nope, no useful tutorials at all.

    JGoodies是Swing顶部的另一层,比如SwingX。它试图使Swing使用起来更愉快。这个网站看起来很棒。让我们看一看教程…嗯……仍然搜索…坚持下去。看起来网站上根本没有文档。谷歌的救援。没有,没有有用的教程。

    I'm not feeling confident with a UI framework that tries so hard to hide the documentation from potential new fans. That doesn't mean JGoodies is bad; I just couldn't find anything good to say about it but that it looks nice.

    我对一个试图将文档从潜在的新粉丝中隐藏起来的UI框架感到不太自信。这并不意味着JGoodies是坏的;我只是觉得没什么好说的,不过看起来不错。

  4. JavaFX. Great, stylish. Support is there but I feel it's more of a shiny toy than a serious UI framework. This feeling roots in the lack of complex UI components like tree tables. There is a webkit-based component to display HTML.

    JavaFX。很好,时尚。支持是存在的,但我觉得它更像是一个闪亮的玩具,而不是一个严肃的UI框架。这种感觉源于缺少复杂的UI组件,比如树表。有一个基于webkit的组件来显示HTML。

    When it was introduced, my first thought was "five years too late." If your aim is a nice app for phones or web sites, good. If your aim is professional desktop application, make sure it delivers what you need.

    当它被介绍的时候,我的第一个想法是“五年太迟了”。如果你的目标是一个很好的手机或网站应用程序,很好。如果你的目标是专业的桌面应用程序,确保它提供你所需要的。

  5. Pivot. First time I heard about it. It's basically a new UI framework based on Java2D. So I gave it a try yesterday. No Swing, just tiny bit of AWT (new Font(...)).

    主。我第一次听说这件事。它基本上是基于Java2D的一个新的UI框架。所以我昨天试了一下。没有秋千,只有很小的AWT(新字体(…))。

    My first impression was a nice one. There is an extensive documentation that helps you getting started. Most of the examples come with live demos (Note: You must have Java enabled in your web browser; this is a security risk) in the web page, so you can see the code and the resulting application side by side.

    我的第一印象很好。有大量的文档可以帮助您入门。大多数示例都带有实时演示(注意:您必须在web浏览器中启用Java;这是web页面中的安全风险,因此您可以看到代码和生成的应用程序。

    In my experience, more effort goes into code than into documentation. By looking at the Pivot docs, a lot of effort must have went into the code. Note that there is currently a bug which prevents some of the examples to work (PIVOT-858) in your browser.

    在我的经验中,更多的精力放在代码而不是文档中。通过查看Pivot文档,很多工作都必须投入到代码中。请注意,目前存在一个bug,它阻止了您的浏览器中的一些示例工作(PIVOT-858)。

    My second impression of Pivot is that it's easy to use. When I ran into a problem, I could usually solve it quickly by looking at an example. I'm missing a reference of all the styles which each component supports, though.

    我对Pivot的第二个印象是它很容易使用。当我遇到一个问题时,我通常可以通过看一个例子来快速解决它。不过,我忽略了每个组件支持的所有样式的引用。

    As with JavaFX, it's missing some higher level components like a tree table component (PIVOT-306). I didn't try lazy loading with the table view. My impression is that if the underlying model uses lazy loading, then that's enough.

    与JavaFX一样,它缺少一些更高级别的组件,比如树表组件(PIVOT-306)。我没有尝试用表视图来加载延迟加载。我的印象是,如果底层模型使用惰性加载,那就足够了。

    Promising. If you can, give it a try.

    有前途。如果可以的话,试一试。

#2


13  

SWT by itself is pretty low-level, and it uses the platform's native widgets through JNI. It is not related to Swing and AWT at all. The Eclipse IDE and all Eclipse-based Rich Client Applications, like the Vuze BitTorrent client, are built using SWT. Also, if you are developing Eclipse plugins, you will typically use SWT.
I have been developing Eclipse-based applications and plugins for almost 5 years now, so I'm clearly biased. However, I also have extensive experience in working with SWT and the JFace UI toolkit, which is built on top of it. I have found JFace to be very rich and powerful; in some cases it might even be the main reason for choosing SWT. It enables you to whip up a working UI quite quickly, as long as it is IDE-like (with tables, trees, native controls, etc). Of course you can integrate your custom controls as well, but that takes some extra effort.

SWT本身是相当低级的,它通过JNI使用平台的原生部件。它与Swing和AWT无关。Eclipse IDE和所有基于Eclipse的富客户机应用程序(比如Vuze BitTorrent客户端)都是使用SWT构建的。另外,如果您正在开发Eclipse插件,通常会使用SWT。我已经开发基于eclipse的应用程序和插件已经有5年了,所以我显然有偏见。但是,我在SWT和JFace UI工具包的工作方面也有丰富的经验,它是建立在它之上的。我发现JFace非常有钱有势;在某些情况下,它甚至可能是选择SWT的主要原因。它使您能够快速地启动一个工作UI,只要它是理想的(有表、树、本机控件等)。当然,您也可以集成您的自定义控件,但这需要额外的努力。

#3


11  

I would like to suggest another framework: Apache Pivot http://pivot.apache.org/.

我想建议另一个框架:Apache Pivot http://pivot.apache.org/。

I tried it briefly and was impressed by what it can offer as an RIA (Rich Internet Application) framework ala Flash.

我做了简短的尝试,并对它作为RIA(丰富的Internet应用程序)框架所能提供的东西印象深刻。

It renders UI using Java2D, thus minimizing the impact of (IMO, bloated) legacies of Swing and AWT.

它使用Java2D呈现UI,从而最小化Swing和AWT的影响(IMO,臃肿的)。

#4


9  

Swing + SwingX + Miglayout is my combination of choice. Miglayout is so much simpler than Swings perceived 200 different layout managers and much more powerful. Also, it provides you with the ability to "debug" your layouts, which is especially handy when creating complex layouts.

Swing + SwingX + Miglayout是我选择的组合。Miglayout比200个不同的布局管理器要简单得多,而且功能更强大。此外,它还为您提供了“调试”您的布局的能力,这在创建复杂的布局时特别有用。

#5


9  

Another option is to use Qt Jambi. It has nearly all the greatness of Qt (many components, good documentation, easy to use), without the hassle of C++. I used it 3-4 years ago for a small project, even then it was almost mature.

另一种选择是使用Qt Jambi。它几乎拥有Qt的所有优点(许多组件,良好的文档,易于使用),没有c++的麻烦。3-4年前,我用它做了一个小项目,当时它几乎已经成熟了。

You might want to see the discussion about Swing vs. Qt here.

您可能希望看到关于Swing和Qt的讨论。

#6


5  

My personal opinion: Go for Swing together with the NetBeans platform.

我个人的观点是:和NetBeans平台一起去玩秋千。

If you need advanced components (more than NetBeans offers) you can easily integrate SwingX without problems (or JGoodies) as the NetBeans platform is completely based on Swing.

如果您需要高级组件(超过NetBeans提供的),您可以很容易地将SwingX集成到没有问题(或JGoodies)的情况下,因为NetBeans平台完全基于Swing。

I would not start a large desktop application (or one that is going to be large) without a good platform that is build upon the underlying UI framework.

如果没有构建在底层UI框架上的良好平台,我就不会启动一个大型的桌面应用程序(或者一个大型的桌面应用程序)。

The other option is SWT together with the Eclipse RCP, but it's harder (though not impossible) to integrate "pure" Swing components into such an application.

另一种选择是与Eclipse RCP一起使用SWT,但是将“纯”Swing组件集成到这样的应用程序中是比较困难的(尽管不是不可能的)。

The learning curve is a bit steep for the NetBeans platform (although I guess that's true for Eclipse as well) but there are some good books around which I would highly recommend.

对于NetBeans平台来说,学习曲线有点陡峭(虽然我想这对Eclipse来说也是如此),但是有一些不错的书籍我强烈推荐。

#7


4  

you forgot for Java Desktop Aplication based on JSR296 as built-in Swing Framework in NetBeans

您忘记了基于JSR296作为NetBeans内置Swing框架的Java桌面应用程序。

excluding AWT and JavaFX are all of your desribed frameworks are based on Swing, if you'll start with Swing then you'd be understand (clearly) for all these Swing's (Based Frameworks)

除了AWT和JavaFX之外,所有的desribed框架都是基于Swing的,如果您从Swing开始,那么对于所有这些Swing的(基于框架),您将会理解(很清楚)

ATW, SWT (Eclipse), Java Desktop Aplication(Netbeans), SwingX, JGoodies

ATW, SWT (Eclipse), Java Desktop Aplication(Netbeans), SwingX, JGoodies。

all there frameworks (I don't know something more about JGoodies) incl. JavaFX haven't long time any progress, lots of Swing's Based Frameworks are stoped, if not then without newest version

所有的框架(我不知道更多关于JGoodies的东西)。JavaFX没有任何进展,很多Swing的框架都被停止了,如果没有最新版本的话。

just my view - best of them is SwingX, but required deepest knowledge about Swing,

我的观点是,最好的是SwingX,但需要对Swing的深入了解,

Look and Feel for Swing's Based Frameworks

查看和感受Swing的框架。

#8


3  

I've been quite happy with Swing for the desktop applications I've been involved in. However, I do share your view on Swing not offering advanced components. What I've done in these cases is to go for JIDE. It's not free, but not that pricey either and it gives you a whole lot more tools under your belt. Specifically, they do offer a filterable TreeTable.

对于我参与的桌面应用程序,我非常高兴。但是,我确实同意您的观点,Swing没有提供高级组件。我在这些案例中所做的就是去JIDE。它不是免费的,但也不是很贵,它给你提供了更多的工具。具体来说,它们确实提供了一个可过滤的树。

#9


3  

I would go with Swing. For layout I would use JGoodies form layout. Its worth studying the white paper on the Form Layout here - http://www.jgoodies.com/freeware/forms/

我要去荡秋千。对于布局,我将使用JGoodies表单布局。它值得在这里研究表单布局的白皮书——http://www.jgoodies.com/freeware/forms/。

Also if you are going to start developing a huge desktop application, you will definitely need a framework. Others have pointed out the netbeans framework. I didnt like it much so wrote a new one that we now use in my company. I have put it onto sourceforge, but didnt find the time to document it much. Here's the link to browse the code:

此外,如果您打算开始开发一个巨大的桌面应用程序,您肯定需要一个框架。其他人指出了netbeans框架。我不太喜欢它,所以写了一个新的,我们现在在我的公司使用。我已经把它放在sourceforge上了,但是没有找到时间来记录它。下面是浏览代码的链接:

http://swingobj.svn.sourceforge.net/viewvc/swingobj/

http://swingobj.svn.sourceforge.net/viewvc/swingobj/

The showcase should show you how to do a simple logon actually..

这个展示应该告诉你如何做一个简单的登录。

Let me know if you have any questions on it I could help.

如果你有什么问题,请告诉我,我可以帮忙。