SWT(Standard Widget Toolkit),最初由IBM开发的一套用于Java的图形用户界面系统,用来与Swing竞争。
开源集成开发环境Eclipse就是用Java和SWT开发的。
设计
![Thumb](http://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Screenshot-swt-helloworld.png/220px-Screenshot-swt-helloworld.png)
下列为基本使用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.