I'm working on a Java Swing application. I have a button whose action runs a query on a database and then plots the results. These commands are performed from the listener on the Run button. As I understand it, this means that the thread running at this point is from the EventQueue.
Given certain input, I need to halt processing and wait for the user to click on the plot area. I'm struggling with finding a way to do this. I've looked all over, but I can't seem to find a solution that works. I've tried to create a new thread that waits for the user input (I call join on this thread). The problem is that this makes the previous thread (from the EventQueue) wait. For some reason, the mouse clicks are not causing an interrupt so the mouse clicks are never captured.
Any help would be much appreciated. Thanks in advance.