code: private void enableActions() {
          restoreAction.setEnabled(isParentMaximum() || isParentIcon());
          maximizeAction.setEnabled((isParentMaximizable() && !isParentMaximum() && !isParentIcon())
                                        || (isParentMaximizable() && isParentIcon()));
          iconifyAction.setEnabled(isParentIconifiable() && !isParentIcon());
          closeAction.setEnabled(isParentClosable());
          sizeAction.setEnabled(false);
          moveAction.setEnabled(false);
      }
docs: Enable/disable the button actions as needed.