Reputation: 3521
In my application I have an SWT text field. I need to set a scroll value (roll the text in the field to the end in my case). How I can do that?
Upvotes: 0
Views: 1349
Reputation: 2271
This should have the desired result without moving the cursor position:
text.setTopIndex(text.getLineCount() - 1);
Upvotes: 3
Reputation: 78643
You need to set the carat to that position, which will cause the text to scroll to that position. For example:
text.setSelection(text.getText().length());
Upvotes: 0