[EMAIL PROTECTED] wrote:

no matter what you do, if you add to something enough, you will run out of memory. even if you append it to a file on the hard disk.

Right.. what I wasn't sure of was whether or not the JTextArea
class maybe had some "built-in" feature for throwing away data.
My assumption was that it probably does not, and the more I read, that does seem to be the case.



if it's ephemera that you can dispose of periodically, watch the size and overwrite it when it reaches a certain size.

It is ephemera.. it's just there so somebody can come in in the morning, glance at the console, and see the most recent few messages.

Unfortunately my first approach to doing the "watch and overwrite" doesn't work. I was trying to call Document.remove() inside the
insertUpdate() method of a class implementing DocumentListener,
but that creates an IllegalStateException. I think I can use
the same basic approach, but it looks like I'll just put that code
in a utility method and call it everytime I call append() on the
jTextArea. Unless somebody can recommend a better way. :-)



Thanks

Phil
--
Vote Badnarik for President 2004
www.badnarik.org

FREE AMERICA
Vote Libertarian
www.lp.org

_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to