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:
Usually the "update text field" is done using publish and process:
Note that JTextArea.append is special; it is already thread safe so the publish-process pair is not needed for it. For just about any other GUI updating code
you should use the pair.
Note the use of Void in my pseudo code. Void is a special class that represents "nothing", and because it can never be instantiated at all it has only one valid value: null. I chose it because doInBackground doesn't need to return anything.