boolean (@NotNull ValidationInfo info, @NotNull MouseEvent e) { if (info.component != null && info.component.isShowing()) { Rectangle screenBounds = new Rectangle(info.component.getLocationOnScreen(), info.component.getSize()); return screenBounds.contains(e.getLocationOnScreen()); } else { return false; } }