java swt写桌面程序,Java桌面应用程序:SWT与Swing

I'm a web developer at day and thinking about building my first real desktop application. The idea is to build a tool that automates a very repetitive task in a web application where no API is available.

I know I want to use Java. I used it before for web stuff, know the syntax pretty well and want the application to be cross plattform as easy as possible.

Where I'm not so sure is if I should use SWT or Swing. As my main audience uses Windows, I want to look it as native as possible there. Linux and Mac should work, but the looks are not so important here.

So what are the arguments for and against each UI Framework, Swing or SWT?

Thanks.

PS: I develop on Windows using Eclipse. But was thinking about playing with Netbeans.

解决方案

Pros Swing:

part of java library, no need for

additional native libraries

works the same way on all platforms

Integrated GUI Editor in Netbeans and Eclipse

good online tutorials by Sun/Oracle

Supported by official java extensions (like java OpenGL)

Cons Swing:

Native look and feel may behave

different from the real native

system.

heavy components (native/awt) hide swing components, not a problem most of the time as as use of heavy components is rather rare

Pros SWT:

uses native elements when possible, so always native behavior

supported by eclipse, gui editor VEP (VEP also supports Swing and AWT)

large number of examples online

has an integrated awt/swt bridge to allow use of awt and swing components

Cons SWT:

requires native libraries for each

supported system

may not support every behavior on all systems because of native

resources used (hint options)

managing native resources, while native components will often be disposed with their parent other resources such as Fonts have to be manually released or registered as dispose listener to a component for automatic release.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值