/*
* 导入包
* org.eclipse.jface_3.6.0.I20100601-0800.jar
* org.eclipse.core.commands_3.6.0.I20100512-1500.jar
* org.eclipse.equinox.common_3.6.0.v20100503.jar
* 以上三个包必须导入,否则出错
*/
import org.eclipse.jface.window.*;
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
public class HelloSWT_JFace extends ApplicationWindow {
public HelloSWT_JFace() {
super(null);
}
@Override
protected Control createContents(Composite parent) {
Text helloText = new Text(parent, SWT.CENTER);
helloText.setText("Hello SWT and JFace");
parent.pack();
return parent;
}
public static void main(String[] args) {
HelloSWT_JFace awin = new HelloSWT_JFace();
awin.setBlockOnOpen(true);
awin.open();
Display.getCurrent().dispose();
}
}