Point (@NotNull Dimension size, @Nullable Point _default) { if (myTransparentPane != null) { final Dimension d = myTransparentPane.getSize(); return new Point((d.width - size.width) / 2, (d.height - size.height) / 2); } return _default; }