SWT

SWT
截图
Eclipse的IDE環境是以SWT為基礎之應用
開發者Eclipse基金會
当前版本
  • 4.23 (2022年3月8日)
編輯維基數據鏈接
源代码库
  • github.com/eclipse-platform/eclipse.platform.swt
編輯維基數據鏈接
操作系统跨平台
语言多語言
类型Java平臺部件工具箱
许可协议Eclipse公共授權
网站www.eclipse.org/swt/

SWTStandard Widget Toolkit),最初由IBM开发的一套用于Java的图形用户界面系统,用来与Swing竞争。

开源整合開發環境Eclipse就是用Java和SWT开发的。

設計

編程

在GTK+環境下使用SWT的簡單GUI應用程式

下列為基本使用SWT的Hello World程式。顯示出一個視窗(Shell)及一個標籤。

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

public class HelloWorld 
{
   public static void main (String[] args) 
  {
      Display display = new Display();
      Shell shell = new Shell(display);
      Label label = new Label(shell, SWT.NONE);
      label.setText("Hello World");
      label.pack();
      shell.pack();
      shell.open();
      while (!shell.isDisposed()) 
      {
         if (!display.readAndDispatch()) display.sleep();
      }
      display.dispose();
   }
}

參見

  • 部件工具箱列表英语List of widget toolkits
  • JFace英语JFace

参考资料

  • Northover, Steve; Wilson, Mike. SWT: The Standard Widget Toolkit, Volume 1. Addison-Wesley. July 8, 2004: 592 [2012-07-10]. ISBN 0-321-25663-8. (原始内容存档于2008-12-22). 
  • Warner, Rob; Harris, Robert L. The definitive guide to SWT and JFace. Apress. June 21, 2004: 684 [2012年7月10日]. ISBN 1-59059-325-1. (原始内容存档于2010年12月5日). 
  • Clayberg, Eric; Rubel, Dan. Eclipse: Building commercial-quality plug-in 2nd. Addison-Wesley Professional. April 1, 2006: 864 [2012-07-10]. ISBN 0-321-42672-X. (原始内容存档于2012-01-14). 
  • Gamma, Erich; Beck, Kent. Contributing to Eclipse. Addison-Wesley. October 30, 2003: 416 [2012-07-10]. ISBN 0-321-20575-8. (原始内容存档于2008-12-22). 
  • D'Anjou, Jim; Fairbrother, Scott; Kehn, Dan; McCarthy, Pat; Kellerman, John. The Java Developers Guide to Eclipse 2nd. Addison-Wesley. November 5, 2004: 1136 [2012-07-10]. ISBN 0-321-30502-7. (原始内容存档于2012-04-19). 
  • Matthew Scarpino, Stephen Holder, Stanford Ng and Laurent Mihalkovic. SWT/JFace in Action. Manning. November 28, 2004: 496. ISBN 1-932394-27-3. 

外部連結

  • SWT main page(页面存档备份,存于互联网档案馆
  • SWT newsgroup[永久失效連結](這個新聞群組被密碼所保護;密碼申請由這)
  • Eclipse applications
  • Eclipse applications, part 2
  • Further information on SWT
  • Information on Eclipse,including SWT information within a "platform plug-in developer guide"
  • SWT Javadoc API(页面存档备份,存于互联网档案馆) documented at eclipse.org