Okay, this should be an easy one to answer, but I just can't figure it out...
I have a JTextArea that I am appending text to. I put it inside a JScrollPane so that I can get a scroll bar. The problem is that when I get enough text in the JTextArea for the scrollbar to appear, I would like the visible area of the JTextArea to display the new text that I just appended, and shift off the top line of the old text off.
Sumarizing...all I want is for the JTextArea to automatically scroll down as I add more text.
JTextArea statusBox = new JTextArea("Welcome!"+'\n');
JScrollPane scrollBox = new JScrollPane(statusBox);
String text = "....";
statusBox.append(text + '\n');
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL