🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9658

Re: JTextArea: How can i make this behave like a console/log viewer

#9658
From: bjm989
Date: Fri, 11 Feb 2000 00:00
30 lines
1577 bytes
You may want to consider keeping the text in a StringBuffer and using
this as your model. I believe that a text area will always allow the
same number characters to be typed per line. So you can control what
text is shown by keeping track of the size of the stringbuffer and as
you add to it, you can remove characters from the front line by line.
Hope this helps,
Ben

>
> im using a JTextArea to display text messages. im appending strings
line by
> line.
>
> as the message grows beyond a certain limit (say 40 lines of text or
beyond
> the viewing area) the messages at the top should get deleted and the
new
> messages should be appended to the bottom.
>
> can any one give me possible solution or an idea !
> thanks for even just considering it! and THANKS for the solution in
> advance!!
>
> kingsley
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.
Technical Details
Message-ID: <8816g5$8nd$1@nnrp1.deja.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <87vdjn$cqt11@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,b57d3520469f3457
X-Google-Attributes: gid111d45,public
From: bjm989@my-deja.com
Subject: Re: JTextArea: How can i make this behave like a console/log viewer
Date: 2000/02/11
Message-ID: <8816g5$8nd$1@nnrp1.deja.com>
X-Deja-AN: 584539286
References: <87vdjn$cqt11@bornews.borland.com>
X-Http-Proxy: 1.0 x27.deja.com:80 (Squid/1.1.22) for client 198.133.169.33
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Fri Feb 11 14:31:33 2000 GMT
X-MyDeja-Info: XMYDJUIDbjm989
Newsgroups: borland.public.jbuilder.java.swing
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)