Eclipse + SWT 进行 GUI 界面开发 简介
开发环境: Eclipse Version 3.3.2, SWT Version 3.4
SWT官方主页:http://www.eclipse.org/swt/
首先需要下载并配置SWT,http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/index.php#swt
配置eclipse: http://www.eclipse.org/swt/eclipse.php
新建一个project,在新建一个java文件F11运行就会看到一个标题为"Hello World"的窗口了。
其它资源:
“Eclipse GUI 开发”: http://www.ibm.com/developerworks/cn/opensource/top-projects/eclipse.html
SWT官方主页:http://www.eclipse.org/swt/
首先需要下载并配置SWT,http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/index.php#swt
配置eclipse: http://www.eclipse.org/swt/eclipse.php
新建一个project,在新建一个java文件
- import org.eclipse.swt.widgets.*;
- public class Helloworld {
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setText("Hello World");
- shell.setSize(200, 100);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
- }
其它资源:
“Eclipse GUI 开发”: http://www.ibm.com/developerworks/cn/opensource/top-projects/eclipse.html