I've some issues with a Javafx GUI that I'm updating . In this GUI I have a table view , a textarea and a panel (with progress indicators) where I show the progress of the tasks i'm doing in background . Each task is a command executed by a ProcessBuilder.
Everything works well , however after several tasks , the tableview , the textarea and the progress indicator that I'm updating start laging.
For my tasks in background I created a custom class which extends the Task Class:
My function which calls the tasks is working like this :
I wait every time for the success of the previous task before to do the next one . This function is recursive , in fact after the success of the last task , if necessary I'm recalling the function( within the function) to do the same 6 tasks for other data .
After some tests I found that the gui elements are laging after 4-5 calls of the function. I tried to do the same thing without the recursive call but I still have the problem.
After the end of the tasks execution , the gui is really lagy, slow and pretty much unusable.