eclipse中tableviewer怎么增加复选框

2025-05-02 20:16:28

1、在eclipse中新建一个swt-java项目,项目名称javacheck.

eclipse中tableviewer怎么增加复选框

2、在项目中新建一个swt application窗口。

eclipse中tableviewer怎么增加复选框

3、在shell窗口中增加TableViewer、TableViewerColumn。

eclipse中tableviewer怎么增加复选框

4、在TableViewer表格增加数据。{ TableItem ti=new TableItem(table,SWT.NONE); ti.setText(0,"安阳"); ti.setText(1,"300百万"); } { TableItem ti=new TableItem(table,SWT.NONE); ti.setText(0,"郑州"); ti.setText(1,"900百万"); } { TableItem ti=new TableItem(table,SWT.NONE); ti.setText(0,"洛阳"); ti.setText(1,"500百万"); }

eclipse中tableviewer怎么增加复选框

5、在TableViewer中增加复选框。TableViewer tableViewer = new TableViewer(shell,SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION);

eclipse中tableviewer怎么增加复选框

6、运行项目,效果如图。

eclipse中tableviewer怎么增加复选框
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢