Java的GUI框架。有什么选择呢?秋千,SWT,AWT,SwingX,JGoodies数据,JavaFX的,阿帕奇支点? [英] Java GUI frameworks. What to choose? Swing, SWT, AWT, SwingX, JGoodies, JavaFX, Apache Pivot?

查看:1481
本文介绍了Java的GUI框架。有什么选择呢?秋千,SWT,AWT,SwingX,JGoodies数据,JavaFX的,阿帕奇支点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有相当多GUI框架在那里对于Java,但什么是公认的首选今天的框架?

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

以下是我在不同的框架的了解,请如果我错了指正。这是一个非常松散定义一系列的问题,但我仍然认为它有价值,任何人想创建丰富的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.

AWT

AWT

时的摆动的根基,它表现良好,但缺乏先进的组件。如果您打算创建丰富的应用程序,AWT可能不是要走的路。然而,对于不需要丰富的用户界面更小的GUI应用程序。因为它是一个久经考验的框架,这可能完全适合。

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为previously说明。在起步阶段就被认为是缓慢和马车,造成IBM为Eclipse中创建SWT。然而,随着Java 5中(或6?)摆成了首选构建新的应用程序的框架。秋千有很多丰富的组件,但在某些领域仍然缺乏。一个例子是有不是全功能treetable中组分可以做排序和过滤/搜索。

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.

SWT

SWT

创建由IBM为Eclipse,他们似乎认为,摇摆并没有在当时适用于Eclipse中。就其本身而言是pretty低的水平,并通过JNI使用平台的本机部件。它是不相关的摆动和AWT的。他们的API然而有些笨重,不直观。他们确实有一些先进的组件就像一个treetable中。 (但我不认为他们支持排序和过滤开箱)。 SWT使用一些天然绑定(通过JNIα)和在互联网上的咆哮的是,这个框架不应在今天的项目中。 (为什么不呢?)

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?)

SwingX

SwingX

根据摆动,它的使命是创造挥杆丰富的组件。仍在开发之中。 (不是很活跃,虽然)有一个非常漂亮的一套组件,例如像treetable中。但treetable中不支持筛选和排序,据我所知。然而,它的确支持与突出搜索。

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.

注意SwingX是组件(AFAIU)是扩展或
  现有的Swing组件组成

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

的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约PLAFs和布局。

JGoodies OTOH is about PLAFs and layouts.

的JavaFX


JavaFX

的Java /甲骨文的最新旗舰。有希望在开发丰富的桌面或Web应用程序的事实标准。

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

阿帕奇枢轴

Apache Pivot

它使用的Java2D,从而减少的Swing和AWT的(IMO,臃肿)遗产的影响呈现UI。 (@Augustus Thoo)

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

这是主要焦点似乎是RIA(富互联网应用),但似乎它也可以应用到桌面应用程序。而作为一个个人的评论,看起来很有趣!我特别喜欢,它是一个Apache项目。

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.

<一个href=\"https://cwiki.apache.org/PIVOT/frequently-asked-questions-faq.html\">https://cwiki.apache.org/PIVOT/frequently-asked-questions-faq.html

的Qt Jambi的

Qt Jambi

Java包装到这是写在C / C ++本地Qt库。功能非常强大,广泛使用和接受。有很多GUI组件和一个易于使用的API。

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.

http://qt-jambi.org/

所以,要尽量总结了一下什么IM问的:

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

说我想创造今天在Java桌面应用程序,涉及了很多先进的组件,我应该选择什么?为什么?

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

哪些框架之一应认定为德precated,哪些应该被承认为遥远的将来的框架?

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

什么是今天的事实上的标准框架和哪些工具您使用创建Java GUI应用程序?

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

我可能会后悔问这个,但生病试试吧,反正

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

C#/。NET是说有一个很好的一套易于使用它可以在各个方向可能被弯曲部件。和调查不同的Java框架,在一定程度之后,就显得我不能说有关Java相同。为什么是这样? 为什么没有的java(这是世界上最广泛使用的程序设计语言),由于具有相同的一组GUI组件?

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?

难道只是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?

推荐答案

决策树:


  1. 像Qt和SWT框架需要本机DLL。所以,你要问自己:是否支持所有必要的平台?您可以与您的应用程序打包本机DLL?

  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?

<一个href=\"http://stackoverflow.com/questions/2037220/how-can-i-creating-executable-jar-with-swt-that-runs-on-all-platforms\">See在这里,如何为SWT 做到这一点。

如果您在这里有一个选择,你应该在SWT preFER Qt的。 Qt的已经被谁了解UI和桌面,而SWT已开发出的必要性,使Eclipse的更快发展的人。它更多的Java 1.4的性能比补丁的UI框架。如果没有JFace的,你错过了许多重大的UI组件或UI组件非常重要的功能(如过滤上表)。

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).

如果SWT丢失,你需要一个功能,该框架是有点敌视扩展它。例如,你不能在它扩展任何类(类不是最终的,他们只是抛出异常,当 this.getClass的包()不是 org.eclipse.swt 键,因为它的签署,你不能在包中添加新的类)。

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).

如果你需要一个人,纯Java的解决方案,即让你的休息。让我们开始与AWT,Swing的,SwingX - Swing的方式

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

AWT已经过时。 Swing是过时的(也许没有那么但没有太多的工作在Swing已经做了近10年)。你可以说,秋千​​是好的开始与但我们都知道,code腐烂。而且,对于用户界面尤其如此今天。

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.

这是给你留下SwingX。进展缓慢一段较长时间后,发展已再度回升的。与Swing的主要缺点是,它挂在一些旧观念这真是太好了前沿15年前,但觉得笨拙的今天。例如,表视图做支撑筛选和排序,但你还是要对此进行配置。你必须写很多锅炉板code的只是为了得到,感觉现代体面的UI。

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.

另一个薄弱环节是主题化。截至今天,有很多主题各地。 看到这里的前10 。但有些慢,有些是越野车,有些是不完整的。我讨厌它,当我写一个用户界面和用户抱怨,因为他们选择了一个奇怪的主题事情不适合他们的工作。

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.

JGoodies数据是在Swing之上另一层,像SwingX。它试图使挥杆更加愉快的使用。该网站看起来不错。让我们来看看教程...唔...仍在寻找......坚持下去。它似乎有在网站上没有文档的。 <一href=\"https://www.google.ch/webhp?sourceid=chrome-instant&ie=UTF-8#hl=en&output=search&sclient=psy-ab&q=jgoodies%20tutorial\">Google救援。不,完全没有有用的教程。

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.

我感觉不自信,试图这么难隐藏潜在的新球迷的文档的UI框架。这并不意味着JGoodies数据是坏的;我只是找不到什么好东西说些什么,但它看起来不错。

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.

JavaFX的。大,外形时尚。支持是有,但我觉得它更像是一个闪亮的玩具不是一个严肃的UI框架。这种感觉根在缺乏像树表的复杂UI组件。有一个基于WebKit的组件来显示HTML

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.

当据介绍,我首先想到的是五年为时已晚。如果你的目标是让手机或网站,好一个漂亮的应用程序。如果你的目标是专业的桌面应用程序,确保它提供了你所需要的。

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.

透视。我第一次听说这件事。它基本上是基于Java2D的一个新的UI框架。所以,我昨天给它一个尝试。无摇摆,AWT的只是点点(新字体(...))。

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(...)).

我的第一个IM pression是一个不错的之一。有一个广泛的文档,可以帮助您开始。大多数例子来与现场演示(注意:您必须具有Java在Web浏览器中启用; 这是在网页中的安全隐患的),所以你可以看到code和并排生成的应用程序的一面。

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.

在我的经验,更多的努力进入code比成文档。通过查看枢轴文档,很多的努力一定是走进了code。需要注意的是,目前这prevents一些例子来工作( PIVOT-858 一个bug )在浏览器中。

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.

枢轴的第二个IM pression是它的易于使用。当我遇到了一个问题,我会通常会很快通过看一个例子解决它。我失去了一切,每个组件支持的样式的引用,虽然。

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.

由于使用JavaFX,它缺少像一棵树表组件一些更高级别的组件( PIVOT-306 )。我没有尝试延迟加载的表视图。我的IM pression是,如果底层模型使用延迟加载,那么这就足够了。

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.

大有可为。如果可以,不妨一试。

Promising. If you can, give it a try.

这篇关于Java的GUI框架。有什么选择呢?秋千,SWT,AWT,SwingX,JGoodies数据,JavaFX的,阿帕奇支点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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