void (@NotNull Point location, @NotNull Rectangle fromScreen, @NotNull Rectangle toScreen) { checkScreensNonEmpty(fromScreen, toScreen); double kw = toScreen.getWidth() / fromScreen.getWidth(); double kh = toScreen.getHeight() / fromScreen.getHeight(); location.setLocation(toScreen.x + (location.x - fromScreen.x) * kw, toScreen.y + (location.y - fromScreen.y) * kh); }