Just a musing about some repetitive code I have:
Runnable run = new Runnable() {
@Override
public void run() {
// Some EDT code
}
};
if (!EventQueue.isDispatchThread()) {
SwingUtilities.invokeAndWait(run);
} else {
run.run();
}
It's not terribly annoying, but it seems like there would be some proprietary function that checks this for you, although I haven't found it.
it seems like there would be some proprietary function that checks this for you
There isn't.