展开全部
final ExpandBar expandBar = new ExpandBar(labelComposite, SWT.V_SCROLL);
expandBar.setSpacing(0);
ExpandItem item_speed = new ExpandItem(expandBar, SWT.NONE);
item_speed.setImage(getBackgroundImage("wenjianjia.gif"));
item_speed.setText("快捷通道");
item_speed.setHeight(menu_length * 25);
item_speed.setControl(composite_speed);
Composite composite_speed = new Composite(expandBar, SWT.NONE);
composite_speed.setLayout(new FormLayout());
Button item_button = new Button(composite_speed, SWT.NONE | SWT.PUSH);
item_button.setText(lable);
item_button.setData(WidgetUtil.CUSTOM_VARIANT, "expandItemButton");
formData = new FormData();
formData.top = new FormAttachment(0,0);
formData.bottom = new FormAttachment(100,0 );
formData.left = new FormAttachment(0, 0);
formData.right = new FormAttachment(100, 0);
item_button.setLayoutData(formData);
一个 简单的例子,可以有多个ExpandItem,我只是想给你看看怎么在里面加按钮
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询