public boolean isEnabled() {
   JInternalFrame iFrame = desktop.getSelectedFrame();
   if (iFrame != null) {
     return iFrame.isMaximizable();
   }
   return false;
 }
 @RunsInCurrentThread
 private static void validateCanMaximize(JInternalFrame internalFrame) {
   validateIsShowingOrIconified(internalFrame);
   if (!internalFrame.isMaximizable())
     throw new IllegalStateException(
         concat("The JInternalFrame <", format(internalFrame), "> is not maximizable"));
 }
 public boolean isEnabled(Object sender) {
   if (sender instanceof JDesktopPane) {
     JDesktopPane dp = (JDesktopPane) sender;
     String action = getName();
     if (action == Actions.NEXT_FRAME || action == Actions.PREVIOUS_FRAME) {
       return true;
     }
     JInternalFrame iFrame = dp.getSelectedFrame();
     if (iFrame == null) {
       return false;
     } else if (action == Actions.CLOSE) {
       return iFrame.isClosable();
     } else if (action == Actions.MINIMIZE) {
       return iFrame.isIconifiable();
     } else if (action == Actions.MAXIMIZE) {
       return iFrame.isMaximizable();
     }
     return true;
   }
   return false;
 }