multithreading - Waiting for mouse input in Java Swing -


I am working on the Java swing application. I have a button whose task runs a query on a database and then returns the results. These commands are done by the listener on the run button as I understand it, this means that the thread running at this point is EventQuote Is from

Looking at some input, I have to wait for the user to stop the processing and click on the plot area. I'm struggling to find a way to do this. I have looked completely, but I can not seem to find a solution that works. I tried to create a new thread that waits for user input (I call to join on this thread). The problem is that it creates the previous thread (from EventQueue) for some reason, mouse clicks are not causing obstacles, so that mouse clicks are not captured.

Any help would be greatly appreciated. thank you in advanced.

Event dispatch and hold handle input two. Instead, your spanded thread should be calculated. I created an interactive UI that did something like that a year or two ago, and in the same way I completed this behavior.

Basically, you create a manufacturer / consumer model between the GUI and the data processing thread. When an input stops, you feed the user thread and start the activity again.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -