if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 4, 0)) {
frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEACTIVATED));
frame.dispatchEvent (new FocusEvent (frame, FocusEvent.FOCUS_LOST));
} else if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 5, 0)) {
frame.dispatchEvent (new WindowEvent (frame, 208 /*WindowEvent.WINDOW_LOST_FOCUS*/));
frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEACTIVATED));
} else {
if (!frame.isActive()) return;
try {
Class clazz = frame.getClass();
Method method = clazz.getMethod("synthesizeWindowActivation", new Class[]{boolean.class});