Java桌面应用程序:SWT与Swing [英] Java Desktop application: SWT vs. Swing

查看:196
本文介绍了Java桌面应用程序:SWT与Swing的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是白天的Web开发人员,正在考虑构建我的第一个真正的桌面应用程序。我们的想法是构建一个工具,在没有API可用的Web应用程序中自动执行非常重复的任务。

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.

我知道我想使用Java。我之前使用它来获取Web内容,很好地了解语法并希望应用程序尽可能简单地交叉平台。

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.

我不确定是否应该使用SWT或Swing。由于我的主要受众使用Windows,我希望尽可能将其视为本机。 Linux和Mac应该可行,但外观在这里并不那么重要。

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.

那么支持和反对每个UI框架,Swing还是SWT的参数是什么?

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

谢谢。

PS:我使用Eclipse在Windows上开发。但是考虑和Netbeans一起玩。

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

推荐答案

优点摆动:


  • java库的一部分,不需要
    额外的本地库

  • 在所有平台上以相同的方式工作

  • Netbeans和Eclipse中的集成GUI编辑器

  • Sun / Oracle的优秀在线教程

  • 官方java扩展支持(比如java OpenGL)

  • 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 / awt)隐藏摇摆组件,大多数时候不是问题,因为使用重型组件相当罕见

优点SWT:


  • 尽可能使用原生元素,因此始终保持原生行为

  • eclipse,gui支持编辑器VEP(VEP也支持Swing和AWT)

  • 大量在线示例

  • 有一个集成的awt / swt桥,允许使用awt和swing组件

  • 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

缺点SWT:


  • 需要本机库每个
    支持的系统

  • 可能不支持所有系统上的所有行为,因为使用了原生
    资源(提示选项)

  • 管理本机资源,而本机组件通常会与其父级其他资源一起处理,例如字体必须手动释放或注册为组件的dispose监听器以进行自动释放。

这篇关于Java桌面应用程序:SWT与Swing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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