UI thread invoke fixes/improvements

This commit is contained in:
honfika@gmail.com
2016-12-28 11:21:13 +01:00
parent e6377fcf98
commit 5b0bd1f0c5
15 changed files with 1574 additions and 1421 deletions

View File

@@ -438,6 +438,12 @@ public class View {
}
}
public static void checkAccess() {
if (!SwingUtilities.isEventDispatchThread()) {
throw new RuntimeException("This method should be called from UI thread.");
}
}
public static void execInEventDispatch(Runnable r) {
if (SwingUtilities.isEventDispatchThread()) {
r.run();