I have a SWT styledText area with scrollBar. I would like the scrollbar to scroll to a given index but I am experiencing some difficulties.
I tried:
ScrollBar vBarScroll = styledText.getVerticalBar();
vBarScroll.setSelection(textIndex);
styledText.showSelection();
This selects the text, which I do not want, as well as having difficulties to display. It jumops around alot too.
The other thing I tried is:
styledText.setTopIndex(textIndex);
But that doesn't work either
Try this:
lineNoIndex is the index of line. 0 -> 1st line 1->Second line etc.