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
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Prepend text in JTextArea
 
Similar Threads
JTextArea help
JTextArea scrolls to bottom
How to scroll to top of JScrollPane
Wanna color some words in my JTextArea- -urgent
JTextarea and JScrollPane