code: private void setParentIcon(boolean iconify) {
          if (rootParent instanceof JFrame) {
              JFrame frame = (JFrame) rootParent;
              int    state = frame.getExtendedState();
  
              ((JFrame) rootParent).setExtendedState(iconify ? state | Frame.ICONIFIED : state & ~Frame.ICONIFIED);
          }
      }
docs: Iconify/Restore the window.
  
  @param iconify {@code true} if we are to iconify the window,
  {@code false} if we are to restore the window.