62,623
社区成员
发帖
与我相关
我的任务
分享 final Composite topComposite = new Composite(shell, SWT.NONE);
// RowLayout topComposite_layout = new RowLayout();
// topComposite_layout.type = SWT.VERTICAL;
// topComposite.setLayout(topComposite_layout);
topComposite.setLayout(new FillLayout());
Tree tree = new Tree(topComposite, SWT.FULL_SELECTION);
TreeItem root = new TreeItem(tree, SWT.NULL);
root.setText("root");
for (int i = 0; i < 10; i++) {
TreeItem item = new TreeItem(root, SWT.NULL);
item.setText("Item" + i);
Image find_image_xiao = new Image(item.getDisplay(),
"E:\\java\\myeclipse'workspace\\XXX_SW\\"
+ "image\\test_image\\frind5hao.png");
item.setImage(find_image_xiao);
} shell.setLayout(new FillLayout());
Composite topComposite = new Composite(shell, SWT.NONE);
// RowLayout topComposite_layout = new RowLayout();
// topComposite_layout.type = SWT.VERTICAL;
// topComposite.setLayout(topComposite_layout);
topComposite.setLayout(new FillLayout());
Tree tree = new Tree(topComposite, SWT.FULL_SELECTION);
TreeItem root = new TreeItem(tree, SWT.NULL);
root.setText("root");
for (int i = 0; i < 10; i++) {
TreeItem item = new TreeItem(root, SWT.NULL);
item.setText("Item" + i);
Image find_image_xiao = new Image(item.getDisplay(),
"E:\\java\\myeclipse'workspace\\XXX_SW\\"
+ "image\\test_image\\frind5hao.png");
item.setImage(find_image_xiao);
}