Rectangle (@NotNull MouseEvent event) { Point location = event.getLocationOnScreen(); for (ArrangementUiComponent component : myComponents) { Rectangle bounds = component.getScreenBounds(); if (bounds != null && bounds.contains(location)) { myComponentUnderMouse = component; return component.onMouseEntered(event); } } return null; }