eclipse中tableviewer怎么增加复选框
1、在eclipse中新建一个swt-java项目,项目名称javacheck.

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

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

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百万"); }

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

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