Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I scroll JScrollPane to the top of a JTextArea?

Status
Not open for further replies.

Felicity

Programmer
Oct 5, 2001
1
AU
I have a JTextArea which is receiving text from files and then being displayed on a dialog box. Because the text is long, I have added a JScrollPane. So far so good. However, the vertical scroll bar is always at the bottom of the text not at the top, which is where you would expect it. So, how can I code it to go back to the top after the text has been added? Any ideas??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top