gpt4 book ai didi

java - StyledText 可见行数

转载 作者:行者123 更新时间:2023-12-01 19:12:16 27 4
gpt4 key购买 nike

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

谢谢。

最佳答案

试试这个代码:

// 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;

关于java - StyledText 可见行数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8010661/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com