checking for mouseReleased event
Hi,
I am trying to find out how to "look ahead" if a mouseReleased event is about to happen, from within a mousePressed method. Here is the pseudocode:
mousePressed(....){
while( mouseNotreleased){
//perform some long running task here.
}
}
mouseReleased(....){
mouseNotReleased = false;
}
from this pseudocode, once a user pressed the mouse, the mousePressed method is called and it will get in a while loop that will not break out of the loop UNTIL the mouse is released.
But the problem is it seems that as long as I am inside the while loop, the mouseReleased event does not get queued even if I've already released the mouse.
I tried ToolKit.getSystemEventQueue().peek() from inside the mousePressed method, but it returns null...... again, this suggests that the mouseReleased event has not been queued yet.
appreciate anyone who can help.

