Ars
Ars

Reputation: 282

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

Upvotes: 1

Views: 4288

Answers (1)

Dyonisos
Dyonisos

Reputation: 3539

You must assign the data as array,

e.g.

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

Upvotes: 5

Related Questions