aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Scroll inside styledText Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Scroll inside styledText" Watch "Scroll inside styledText" New topic

Scroll inside styledText

Liwuen Chew

Joined: Mar 11, 2010
Posts: 24
Recently I made an swt application with an styledtext inside of it. I use the styledtext.setText() method to make the styledText to display a lot of lines. The problem is that the styledText keeps showing the beginning of the list of lines, and it does not scroll down until the last character.
Is there a way to make it scroll down after using the setText method? Thanks!
Rob Spoor

Joined: Oct 27, 2005
Posts: 19557

1) Set the caret position to the end.
2) Set the value of the vertical JScrollBar to its maximum.
3) ??

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Scroll inside styledText
Similar Threads
urgent can somebody get this scrollbar move down
AutoScroll text to bottom of a StyledText component in SWT
Scrolling adjustment
AutoScroll text to bottom of a StyledText component in SWT
How to give scrollbars to JTextArea when lines are greater than 3??