boolean (Component c) { final Window debuggerWindow = SwingUtilities.getWindowAncestor(myComponent); if (!(debuggerWindow instanceof Dialog)) return false; return c == debuggerWindow || SwingUtilities.getWindowAncestor(c) == debuggerWindow; }