While reading this great example about SwingWorker I got a question I would like to ask here:
Assume that the task of searching for a word in text files can be multithreaded, what would be the best way to perform this task in parallel? While searching each file, I need to update a Swing component(JTextarea in this example). Also, I need to update the Component (JTextarea) when all the threads/tasks are completed.
For those who do not want to read the post:
In a nutshell, the background task is to search for a given word in all text files present in a given directory. The search is performed sequentially reading one file at a time. The goal is to search in parallel.