I am writing a program to solve Sudoku puzzles. My user interface is written in Swing.
When a user presses a "Solve" button, an ActionListener for this button is called. This ActionListener invokes a method that solves the Sudoku. However, this solver method is highly processor-intensive. The result is that my entire application becomes unresponsive.
I've tried putting the solver method in its own thread, but this has exactly the same results. I don't know why. Perhaps because the thread is created and run from an ActionListener method?
What are the best practices for "splitting off" processor-intensive calculations that are invoked by the user interface?