コード例 #1
0
 public boolean isEnabled() {
   JInternalFrame iFrame = desktop.getSelectedFrame();
   if (iFrame != null) {
     return iFrame.isMaximizable();
   }
   return false;
 }
コード例 #2
0
 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;
 }