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

2025-05-06 15:45:30

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按钮
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢