You are using the GUI event
thread to do your execution. That's what calls the actionPerformed() method when you click the start button. Since the thread is busy doing your processing it can't get around to handling your stop button. You need to have another thread to handle your processing and have the start and stop buttons invoke notify() and wait() respectively. The
Java Tutorial:
Threads should help you out.