eclipse中tableviewer怎么增加复选框

 时间:2024-10-14 14:22:17

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怎么增加复选框
  • 如何使用CSS 元素选择器
  • 如何安装composer
  • jar,jre,jdk等几个词的区别
  • jquery返回顶部功能如何实现
  • win10系统中wampserver安装后Apache启动不了
  • 热门搜索
    辽宁兴城旅游 苏州旅游景点推荐 河源旅游攻略 昆明附近旅游景点 十堰旅游网 同程旅游招聘 西部旅游景点 哈尔滨雪乡旅游 中南国际旅游公司 驰誉欢途旅游网