File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Android Security Essentials Live Lessons this week in the Android 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: 19656

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
Consider Paul's rocket mass heater.
subject: Scroll inside styledText
Similar Threads
AutoScroll text to bottom of a StyledText component in SWT
How to give scrollbars to JTextArea when lines are greater than 3??
Scrolling adjustment
AutoScroll text to bottom of a StyledText component in SWT
urgent can somebody get this scrollbar move down