简体   繁体   中英

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 :-

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.

Thanks, @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" });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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