I had this problem too. I got my own conclusions, but I don't know if is 100%
correctly!
I'll tell you my solution, if it's wrong in any aspect someone correct me ok?
When a event occurs, its action run at the Event dispath thread to avoid that
other user action interrupt the event. So you can't unlock any other thread. In
my code, I've created another thread to notify().
public void actionPreformed(ActionEvent event)
{
Thread theNewThread = new Thread(new Runnable() {
public void run() {
notify();
}
});
}
Try this, use the code segment that follow to debug your program and understand
better in which thread it's running:
System.out.println(Thread.currentThread().getName());
Also, try to find some documentation about the event dispath thread.
I don't really know if this solution will work, but I hope that it help you, at
least, in some aspect.