I think this will fall under the category of a newbie
thread question.
In the contractor assignment, I have a Search button and a Cancel Search button. Only one is enabled at any time. A press of Search will fork a new thread to call a find method on my DatabaseInterface. This call eventually makes its way to the Data class and I have that search done in another Thread.
If the user then presses the Cancel Search button, the a Data class method gets called which kills the previous mentioned search thread by setting a boolean in its thread class. That boolean is part of the loop control
test so it's like a polling mechanism, which I think is ugly.
It works (I tested it by creating a larger .db file and adding a sleep), but is what I'm doing bad practice, and if so as I suspect, what is the best way?