aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Prepend text in JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Prepend text in JTextArea" Watch "Prepend text in JTextArea" New topic
Author

Prepend text in JTextArea

ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
Is there a way to PREPEND text in a JTextArea rather that APPEND it?
I want the most recent addtions of text in the JTextArea to be at the top, not the bottom.
I do have JTextArea in a JScrollPane, but I would rather have ppl scroll down to see old messages and have the new onese at the top...
Any ideas?


Ryan Headley<br /><a href="http://www.sudovi.com" target="_blank" rel="nofollow">http://www.sudovi.com</a>
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Ryan,
Have a look at the insert method of JTextArea. Using position of zero should get the front.
Regards,
Manfred.
ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
Thanx,
I will give that a try...
Ryan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Prepend text in JTextArea