SWT(Standard Widget Toolkit),最初由IBM開發的一套用於Java的圖形用戶界面系統,用來與Swing競爭。
開源整合開發環境Eclipse就是用Java和SWT開發的。
設計
下列為基本使用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();
}
}
參見
- 部件工具箱列表
- 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
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.