I have a method that shows a modal dialog asking the user for
certain information when he/she double clicks in a window.

The problem is that if the user clicks so fast that
he/she produces two consecutives double clicks, the method is
invoked twice, showing two modal dialogs at the same time (one
above the another one) instead of only one.

I've checked that since the method is executing in the event
dispatching thread (since it is called when a double click is
detected), the method is called twice (the second time is called
before the first call is finished -I don't understand why this
happens, since, altough it's the event dispatching thread, I
think it has to call the methods in sequence-) at the same time.

I have to avoid this wrong behaviour. I've tried to define the method
as synchronized, but this doesn't work since the two calls are executing
(simultaneously!!!) in the same thread, so no mutual exclusion is 
guaranteed with synchronized (this modifier only guarantees mutual 
exclusion between different threads -anyway, I couldn't imagine before a
thread executing twice the same method at the same time-).

I hope you can help me, because I have to solve this problem and I don't
even understand what is happen.

Thanks a lot.

_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to