一个JAVA界面
来源:百度知道 编辑:UC知道 时间:2024/05/22 11:47:28
请问,我不是想单独建一个PShelf我建的是和其他的在同一个JFrame内,而这个方法建的是单独的,怎么把它建在里面呢?
效果图与包下载地址:
http://www.eclipse.org/nebula/widgets/pshelf/pshelf.php
package example5.org.eclipse.nebula.widgets;
import org.eclipse.nebula.widgets.pshelf.PShelf;
public class PShelfSnippet1 {
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new FillLayout());
PShelf shelf = new PShelf(shell, SWT.NONE);
PShelfItem item1 = new PShelfItem(shelf,SWT.NONE);
item1.setText("First Item");
item1.getBody().setLayout(new FillLayout());
Table table = new Table(item1.getBody(),SWT.NONE);
TableColumn col1 = new TableColumn(table,SWT.NONE);
col1.setText("Column");
table.setHeaderVisible(true);
col1.setW