I have a method a point of entry to which I can't manage, but it's always invoked on EDT.
public Object doLengthyOperation() throws Exception {
// do some stuff
return operationResult;
}
I would like to process the operation in a separate thread but I don't want to block the EDT. So the easy way is to show a modal dialog and to hide it when the operation processed. But the operation may last a small amount of time and in that case I want to avoid the dialog. I need something that acts like a modal dialog without a real dialog. When the method returns I should stay on EDT, so I can't simply push a new EventQueue and pop it when the operation done.