首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >StyledText可见线数

StyledText可见线数
EN

Stack Overflow用户
提问于 2011-11-04 22:21:50
回答 1查看 433关注 0票数 0

我想知道StyledText实际显示了多少行。这有可能吗?

谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-04 22:29:18

尝试以下代码:

代码语言:javascript
复制
// The index of the last (possibly only partially) visible line of the widget
int bottomIndex = JFaceTextUtil.getPartialBottomIndex((StyledText)widget);
// The index of the first (possibly only partially) visible line of the widget
int topIndex = JFaceTextUtil.getPartialTopIndex((StyledText)widget);


int visibleLines = bottomIndex - topIndex;
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8010661

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档