I have 3 threads on a frame and when I press the "Exit" button I want o stop the threads which are currently running and after that to close the frame with the program. For that I created an array where I have all the Threads of the frame and when the button "Exit" is pressed the program iterates over the array and if is there any
thread running I interrupt it. The problem with my approch is that the program stops only 1 thread, not all of them. So, even though the frame is closed, there will be 2 threads running on the background.
Here is my program:
Interrupt multiple threads on the same time