2011-11-04 5 views

답변

4

이 코드를보십시오 :

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

이 근무! 나는 그것을하는 또 다른 방법을 찾았지만 당신의 것이 더 낫다. getBounds(). 높이/(getLinePixel (2) - getLinePixel (1) – aphex