SWT学习:[2]Table中添加Button按钮

2024-10-17 09:42:53

1、以在Table中添加buton控件为例。

SWT学习:[2]Table中添加Button按钮

3、创建TableItem,设置TableEditor,把Button控件加入。TableE蟠校盯昂ditor editor = new TableEditor();editor.grabHorizontal = true;//自动填充表格editor.minimumHeight = buttons.getSize().y;//设置editor最小高度editor.minimumWidth = buttons.getSize().x;//最小宽度editor.setEditor(buttons, item, columnIndex);//指定给哪个单元格设置该控件。

SWT学习:[2]Table中添加Button按钮SWT学习:[2]Table中添加Button按钮

6、当删除Table中的某一个控件时,需要将控件和Editor都删除。button.dispose();editor.dispose();然后Table再删除该行记录。

SWT学习:[2]Table中添加Button按钮
猜你喜欢