简体   繁体   English

在SWT表列中填充数据

[英]Populate data in SWT table column

I have developed one table having 3 comlumns and 10 rows, Now to insert the data explicitly I am using :- 我已经开发了一个包含3个列和10行的表,现在要显式插入数据,我正在使用:-

TableItem tableItem_1= new TableItem(Table, SWT.NONE);
tableItem_1.setText(0, "1.");

above code is inserting data in 1st row 1st column, but when i am changing the index from 0 to 1, then its starting from the adjacent cell of the next column but not exactly the next cell of the next column, plz help. 上面的代码是在第一行第一列中插入数据,但是当我将索引从0更改为1时,它是从下一列的相邻单元格开始的,而不是从下一列的下一单元格开始的,plz帮助。

Thanks, @rs 谢谢@rs

You must assign the data as array, 您必须将数据分配为数组,

eg 例如

TableItem item1 = new TableItem(t, SWT.NONE);
    item1.setText(new String[] { "Column1 text", "Column2 text", "Column3 text" });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM