I'm writing a piece of code that essentially iterates over a file containing a number of URLs, reads the corresponding HTMLs, runs a series of search operations on the HTMLs and the returns the results of these searches. I want these results to be displayed in a TextArea section of the UI too.
However, when I use the appendText method to display the search results, the TextArea is not updated immediately, not even at the end of the current iteration, it only updates once the whole loop has finished. This is a problem for users because there's no way to know if the application is stuck on an error or is just processing normally.
For comparison, I have included a System.out.println right after each appendText and the console does actually update in real time.
Am I doing anything wrong or is this the expected behavior of a TextArea? Is there anything I can do to make it more responsive?