参考资料:http://book.51cto.com/art/200801/64056.htm 代码如下: package swt_jface.demo9; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ViewForm; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class ViewFormExample { Display display = new Display(); Shell shell = new Shell(display); public ViewFormExample() { shell.setLayout(new FillLayout()); final ViewForm viewForm = new ViewForm(shell, SWT.BORDER); Label label = new Label(viewForm, SWT.NULL); label.setText("Top center"); viewForm.setTopCenter(label); shell.setSize(400, 200); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } public static void main(String[] args) { new ViewFormExample(); } }