static bool isInForeground(Component c) { JFrame f = getFrame(c); ret f != null && (f.isFocused() || f.isAlwaysOnTop()); }