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

Quick Facts 开发者, 当前版本 ...
SWT
截图
Thumb
Eclipse的IDE环境是以SWT为基础之应用
开发者Eclipse基金会
当前版本
  • 4.23 (2022年3月8日)
编辑维基数据链接
源代码库 编辑维基数据链接
操作系统跨平台
语言多语言
类型Java平台部件工具箱
许可协议Eclipse公共授权
网站www.eclipse.org/swt/
Close

开源集成开发环境Eclipse就是用Java和SWT开发的。

设计

编程

Thumb
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();
   }
}

参见

参考资料

外部链接

Wikiwand in your browser!

Seamless Wikipedia browsing. On steroids.

Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.

Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.