简体   繁体   中英

How to get total number of rows in swt.table

What i want to do is to get all the tableItems from the selected row. but i have find out that the tableItems are stored in indexes (like in arrary) and not like give row and column and store it on specific cell of table (row, column).

So i have to go through all the next rows upto the end of table and then go through all the rows upto the selected row to get to my required tableItem.

在此输入图像描述

See image for clearance of my question. The coloured row is the selected one. If i want to go from 'a' to 'b' and then 'c' and so on for complete row, i have go through all the next rows.

so now the problem is how can i get the total number of rows present in swt.table

A SWT TableItem IS a row in your Table. You can use it's getText(int index) method to get the contents of the column with index (starting from 0 for the first column) of the selected TableItem.

Therefor the number of TableItems is the total number of rows.

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