当前位置: 首页 > 工具软件 > RCP100 > 使用案例 >

java rcp教程_Java RCP中expandbar的简单用法

东方华晖
2023-12-01

展开全部

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);

一个 简单的例子32313133353236313431303231363533e4b893e5b19e31333332616364,可以有多个ExpandItem,我只是想给你看看怎么在里面加按钮

 类似资料: