RelativePoint (@NotNull Point screenPoint, @Nullable Component component) { if (component == null) { return RelativePoint.fromScreen(screenPoint); } SwingUtilities.convertPointFromScreen(screenPoint, component); return new RelativePoint(component, screenPoint); }