So I am working on a GUI application that loads, processes, and writes MIDI files. Everything works, but processing can take about 5 seconds for large files (there is a lot of math so this is understandable) and hitting the “Process” button locks up the GUI while that code is running, and I am supposing that this is because I haven’t done any multithreading.
What is the best approach to take? I am thinking that I will create a friend Thread class of the MainComponent that executes the buttonClicked() code for the “Process” button. So would my MainComponent need a timer that periodically checks to see if “Process” has been completed ? Should I initialize a thread on start-up and have it sleep when not in use?
Thanks in advance,