Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

java - Swing versus SWT

What criteria should I use to choose between SWT and Swing? I assume they both provide satisfactory GUI performance and platform availability.

My personal criteria currently include:

  • layouts/layout managers;
  • data binding;
  • pre-built controls;
  • ease of development.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

My criteria to choose between SWT and Swing:

  1. quality and availibility of documentation (docs, books, tutorials, snippets)
  2. number of custom components (both commercial and free)
  3. quality and availibility of development tools like RAD window builder, platform for automate gui testing..etc.
  4. native look and feel vs custom look and feel
  5. learning curve (related to point one) / ease of development

notice: I have only commercial experience with SWT on small project and my swing experience is so small that can't be taken seriously - my knowledge is rather theoretical than practical.

Briefly after my SWT/Eclipse RCP experience - on next project I would choose Swing. It api seems for me easier than SWT (you haven't got to manage disposing components by hand to prevent memory leaks, you adding component to panel instead of constructing components with parent panel information, former is closer to my previous experience...etc.), native look and feel you can get in swing too, overall performance is enough good (swt should be faster because it's using native components of backed OS - but is the performance gain really big pro? i don't think so..). And there is lot of more custom components in Swing than in SWT (this is very big pro for swing).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...