File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Control Visible Portion of JTextArea Displayed by JScrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Control Visible Portion of JTextArea Displayed by JScrollPane" Watch "Control Visible Portion of JTextArea Displayed by JScrollPane" New topic
Author

Control Visible Portion of JTextArea Displayed by JScrollPane

Tom Cockerline
Greenhorn

Joined: Dec 20, 2003
Posts: 7
Howdy,
I have a JTextArea component that is displayed via a JScrollPane. Sometimes the text message that I place into the JTextArea component is too big to fit in the visible area of the JScrollPane, so the vertical scrollbar is activated. The first time my app encounters such a text message it positions it within the pane such that the top of the message is visible. So far, so good. However, subsequent messages are positioned such that the bottom of the message is visible, so that one has to scroll up to begin reading the message.
Is there a way to force the pane to always position itself at the beginning of the text area?
Thanks in advance,
Tom
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Moved to the Swing Forum.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Control Visible Portion of JTextArea Displayed by JScrollPane