Home / who is hans matheson dating / Updating jtextarea

Updating jtextarea

thanks kevin Since you don't want to stop the GUI from repainting, you will want to disable all your GUI input controls: - disable all input controls - start the new thread that will do the hard work - when that thread has finished let it re-enable all controls again In semi-pseudo code: Note that JText Area.append is special; it is already thread safe so the publish-process pair is not needed for it.

The problem is very simple: I have defined a JText Area and I'm reading text into it.I have a simple text file which will be updated with unique IDs for products by a 3rd party system, I need to display this text file in a Swing app and need it to show the text file updating ... public static void update Text Area(String text) public static void update Text Area(int text) { String ...So i want to send updates to a text area to display to the user. Hello, I have a textarea, that is populated with log messages from clients.Problem is that each append to the JText Area causes the memory footprint of the Java process to jump considerably (a few mb each time) even though I'm re-sizing the document each time.Left on its own, the system will slowly eat up all available memory and eventually the JVM will abort.I think this is a common problem but I havent found a solution yet.I have a process which takes a long time, and I at least wants to show something, anything, on the gui, to let the user know that the program is still running (and it is not hanged or something). Hi guys Just wondering is it possible to get a realtime update (refresh, repaint or something) of a Text Area in Swing?You will not have been able to read and understand that whole tutorial in under 7 minutes. but to be fair to me this tutorial still does not answer the question of how to pause a thread in effectively the same way as my suggested loop without the overheads.However I appreciate the sort of help provided here so many thanks to people who spend there time helping persons such as myself kindness prevails.Once the underlying Document size is a pre-determined maximum size (say 5000 chars) I start to trim off the top X number of chars as I append a new set of chars to the end.Thus it is intended to behave as a FIFO scrolling text field.


  1. Jul 24, 2015. A sample Swing program that demonstrates how to redirect standard output streams to a Swing component like a JTextArea.

  2. Apr 29, 2012. Hi, I'm currently writing a application, which on a mouse click runs several methods which updates a JtextArea. The problem is even though I'm updating the text area with each method call, it doesn't actually update until everything in the mouseclick has run. This can take quite a while to run through.

  3. I think That should work. In fact, you should only need the setText call. My guess is that you're function isn't getting called for some reason. Put a break point in your code and make sure it's getting called.

Leave a Reply

Your email address will not be published. Required fields are marked *