void (@NotNull MouseEvent event) { Rectangle buttonBounds = getCloseButtonScreenBounds(); if (buttonBounds != null && myCloseCallback != null && buttonBounds.contains(event.getLocationOnScreen())) { myCloseCallback.consume(this); event.consume(); } }