Stopping a thread using a stop button - GUI
I've got an app all made, looking lovely.
But... I have a GUI that has start and stop buttons. Start button kicks off a new thread to capture packets. Working fine.
The stop button, this needs to stop capturing the packets but keep the actual program running - so System.exit(); isn't suitable (different button for that).
I've read up on it and it seems like interrupt is my best bet but I can't get it to work. Is there just a simple line that I can put in to stop the thread?