public static boolean canBeMaximized(JDialog dialog) {
    JRootPane rootPane = dialog != null && dialog.isResizable() ? dialog.getRootPane() : null;
    if (rootPane == null) return false;
    return !almostEquals(ScreenUtil.getScreenRectangle(dialog), dialog.getBounds());
  }
public static boolean canBeMaximized(JDialog dialog)