热门问题
时间线
聊天
视角

標準部件工具箱

来自维基百科,自由的百科全书

標準部件工具箱
Remove ads

標準部件工具箱(英語:Standard Widget Toolkit,縮寫SWT)是最初由IBM開發的一套用於Java圖形用戶界面系統,用來與Swing競爭。

快速預覽 開發者, 當前版本 ...

開源整合開發環境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();
   }
}
Remove ads

參見

參考資料

Remove ads

外部連結

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads