开发者

How do I find out what is the first visible item (string) in a SWT List

开发者 https://www.devze.com 2023-02-07 01:28 出处:网络
I have a List in my dialog and I want to find out what开发者_高级运维 it the first visible String in the list where ever the list is scrolled at that moment. Is there a way of doing that ?List.getTopI

I have a List in my dialog and I want to find out what开发者_高级运维 it the first visible String in the list where ever the list is scrolled at that moment. Is there a way of doing that ?


List.getTopIndex() should be helpful in identifying the index of the top visible element. After the index is obtained, getItem (index) can be used to obtain the string value.

So, the API should be list.getItem (getTopIndex())

0

精彩评论

暂无评论...
验证码 换一张
取 消