mt@ilovefactory.com:But I think you should use invokeAndWait, instead of invokeLater in order to prevent surprises
invokeAndWait can cause serious slow-down as well as deadlocks. invokeLater is safer in that regard. Basically, if you need the values to be set
now, e.g. if your read them later, use invokeAndWait. Otherwise, invokeLater.
In C# I once had a method that looked like this:
public void InvokeIfRequired(Action action) {
if (InvokeIsRequired) {
Invoke(action);
} else {
action();
}
}
You could possibly make something similar so you wouldn't have to copy paste this pattern, though I'm not sure how much that would help in Java.