Java GUI 프레임워크뭘 고를까?Swing, SWT, AWT, SwingX, JGodies, JavaFX, Apache Pivot?
java에는 꽤 많은 gui 프레임워크가 있지만, 오늘날 선택되는 프레임워크는 무엇입니까?
아래는 다른 틀에 대한 저의 이해입니다만, 틀렸다면 정정해 주십시오.이것은 매우 느슨하게 정의된 일련의 질문이지만, 풍부한 GUI 어플리케이션을 만들고 싶다고 생각하는 사람에게는 여전히 도움이 된다고 생각합니다.
스윙의 근간으로 성능은 좋지만 고급 부품은 부족합니다.풍부한 애플리케이션을 작성하려면 , AWT 를 사용하는 것은 적합하지 않을 가능성이 있습니다.다만, 리치 유저 인터페이스를 필요로 하지 않는 소규모의 GUI 애플리케이션에 적합합니다.이것은 시도되고 검증된 프레임워크이기 때문에 완벽하게 적합할 수 있습니다.
앞서 말한 대로 AWT를 기반으로 합니다.초기 단계에서는 느리고 버그가 많은 것으로 간주되어 IBM이 Eclipse용 SWT를 개발하게 되었습니다.그러나 Java 5(또는 6)에서는?Swing은 새로운 어플리케이션 구축을 위한 프레임워크가 되었습니다.그네에는 풍부한 성분이 많이 있지만 아직 부족한 부분이 있다.예를 들어 정렬 및 필터링/검색 기능을 모두 갖춘 TreeTable 구성 요소가 없는 경우가 있습니다.
IBM for Eclipse가 만든 Swing은 당시 Eclipse에 적합하지 않다고 생각하는 것 같습니다.그 자체는 상당히 낮은 수준이며 JNI를 통해 플랫폼의 기본 위젯을 사용합니다.Swing이나 AWT와는 전혀 관계가 없습니다.그러나 API는 다소 투박하고 직관적이지 않습니다.TreeTable과 같은 고급 컴포넌트를 갖추고 있습니다(단, 개봉 즉시 정렬 및 필터링은 지원하지 않습니다).SWT는 (JNI?를 통해) 일부 네이티브 바인딩을 사용하고 있으며, 인터넷에서는 이 프레임워크가 오늘날의 프로젝트에서는 사용되지 않아야 한다고 주장합니다.(왜 안 돼?)
Swing을 기반으로 Swing을 위한 풍부한 부품을 만드는 것이 미션입니다.아직 개발 중입니다.(단, 그다지 액티브하지 않습니다).TreeTable과 같은 매우 좋은 컴포넌트 세트를 준비합니다.그러나 TreeTable은 필터링과 정렬을 지원하지 않습니다.다만, 하이라이트를 사용한 검색은 서포트하고 있습니다.
Swing X는 컴포넌트입니다(AFA).IU) 기존 Swing 컴포넌트의 확장 또는 구성
JGodies
내가 전혀 모르는 틀...장점과 단점은 무엇인가요?Jgoodies는 다른 것들과 뭐가 다른가요?
JGoodies OTOH는 PLAF와 레이아웃에 관한 것입니다.
Java/Oracle의 최신 플래그십. 리치 데스크톱 또는 웹 애플리케이션 개발에서 사실상의 표준이 될 것으로 약속합니다.
Java2D를 사용하여 UI를 렌더링하여 Swing과 AWT의 (IMO, 비대함) 유산 영향을 최소화합니다.(@Augustus Thoo)
RIA(Rich Internet Applications)에 초점을 맞춘 것 같지만 데스크톱 애플리케이션에도 적용할 수 있을 것으로 보인다.그리고 개인적인 의견으로, 매우 흥미로워 보인다!특히 아파치 프로젝트라서 좋아요.
https://cwiki.apache.org/PIVOT/frequently-asked-questions-faq.html
c/c++로 작성된 네이티브 qt 라이브러리에 대한 자바 래퍼.매우 강력하고 널리 사용되고 인정받고 있습니다.많은 GUI 컴포넌트와 사용하기 쉬운 API를 갖추고 있습니다.
그래서 제가 질문한 내용을 조금 요약해 보겠습니다.
현재 Java에서 많은 고급 컴포넌트를 포함하는 데스크톱 애플리케이션을 만들고 싶다고 가정해 보겠습니다. 무엇을 선택해야 합니까?그리고 왜?
이러한 프레임워크 중 어떤 것이 권장되지 않는 것으로 인식되어야 하며 어떤 것이 먼 미래의 프레임워크로 인식되어야 하는가?
현재의 사실상의 표준 프레임워크는 무엇이며 Java GUI 애플리케이션을 작성하기 위해 어떤 툴을 사용하고 있습니까?
이렇게 물어본 걸 후회할 수도 있지만, 어쨌든 시도해 보겠습니다.
C#/.Net은 모든 방향으로 구부릴 수 있는 사용하기 쉬운 컴포넌트 세트를 갖추고 있는 것으로 알려져 있습니다.그리고 자바 프레임워크에 대해 어느 정도 조사한 결과 자바에 대해 같은 말을 할 수 없는 것 같습니다.왜 이러한가?왜 java(세계에서 가장 널리 사용되는 프로그래밍 언어)는 같은 GUI 컴포넌트 세트를 가지고 있지 않은가?
java가 gui 컴포넌트를 훨씬 낮은 레벨로 베이스로 해, 찾고 있는 고도의 컴포넌트를 모두 작성할 수 있습니다만, 모든 작업을 직접 할 필요는 없습니다.
Decision Tree:
QT 및 SWT 등의 프레임워크에는 네이티브 DLL이 필요합니다.그래서 스스로에게 물어봐야 합니다.필요한 플랫폼은 모두 지원되고 있습니까?네이티브 DLL을 앱과 함께 패키징할 수 있습니까?
SWT를 위한 방법은 여기를 참조하십시오.
선택사항이 있다면 SWT보다 QT를 더 선호해야 합니다.QT는 UI와 데스크톱을 이해하는 사람들에 의해 개발되었으며 SWT는 이클립스를 더 빨리 만들기 위해 개발되었습니다.UI 프레임워크라기보다는 Java 1.4용 성능 패치입니다.JFace를 사용하지 않으면 많은 주요 UI 구성 요소 또는 UI 구성 요소의 매우 중요한 기능(예: 테이블 필터링)이 누락됩니다.
SWT에 필요한 기능이 없는 경우 프레임워크는 이를 확장하는 데 다소 적대적입니다.예를 들어 클래스는 확장할 수 없습니다(클래스는 최종 클래스가 아닙니다.패키지가
this.getClass()
하지 않다org.eclipse.swt
서명되어 있기 때문에 패키지에 새 클래스를 추가할 수 없습니다).네이티브의 순수 Java 솔루션이 필요한 경우 나머지는 그대로 사용할 수 있습니다.먼저 AWT, Swing, Swing X - Swing way로 시작합시다.
AWT는 구식입니다.Swing은 시대에 뒤떨어져 있습니다(아마도 그 정도는 아니겠지만, 지난 10년간 Swing에 대한 작업은 많지 않습니다).당신은 Swing이 처음에는 좋았다고 주장할 수 있지만 우리는 모두 그 코드가 부패한다는 것을 알고 있다.이는 오늘날 UI에 특히 해당됩니다.
그럼 Swing X가 남습니다.더 오랜 기간의 느린 진행 끝에 개발은 다시 회복되었다.Swing의 가장 큰 단점은 15년 전만 해도 매우 어설프게 느껴졌던 낡은 아이디어에 매달린다는 것이다.예를 들어 테이블 보기는 필터링 및 정렬을 지원하지만 여전히 구성해야 합니다.모던한 느낌의 UI를 얻으려면 보일러 플레이트 코드를 많이 작성해야 합니다.
또 다른 취약점은 주제화이다.오늘 현재, 많은 주제들이 주위에 있습니다.톱 10에 대해서는, 여기를 참조해 주세요.하지만 어떤 것은 느리고, 어떤 것은 버그가 있고, 어떤 것은 불완전합니다.UI를 쓸 때 이상한 테마를 선택해서 뭔가 안 된다고 불평하는 게 너무 싫어요.
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.
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. 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.
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(...)
).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.
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.
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.
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.
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.
I would like to suggest another framework: 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.
It renders UI using Java2D, thus minimizing the impact of (IMO, bloated) legacies of Swing and AWT.
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.
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.
You might want to see the discussion about Swing vs. Qt here.
My personal opinion: Go for Swing together with the NetBeans platform.
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.
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.
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.
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.
you forgot for Java Desktop Aplication based on JSR296 as built-in Swing Framework in NetBeans
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)
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
just my view - best of them is SwingX, but required deepest knowledge about Swing,
Look and Feel for Swing's Based Frameworks
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.
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/
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:
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.
ReferenceURL : https://stackoverflow.com/questions/7358775/java-gui-frameworks-what-to-choose-swing-swt-awt-swingx-jgoodies-javafx
'programing' 카테고리의 다른 글
Vue - Axios 응답에서 하위 구성 요소의 데이터를 전달합니다. (0) | 2022.08.30 |
---|---|
오류: PostCSS 플러그인을 로드하지 못했습니다. 'postcss-import' 모듈을 찾을 수 없습니다(Vue 2). (0) | 2022.08.30 |
나는 심판 vue 시험 utils를 사용하여 전자 요소를 선택할 수 있다. (0) | 2022.08.30 |
read()와 fread()의 차이점은 무엇입니까? (0) | 2022.08.23 |
Vuex - http 서버에서 스토어 데이터를 로드/초기화하는 시기 (0) | 2022.08.23 |