code: public boolean isInState(JComponent c) {
          Component parent = c.getParent();
  
          while (parent.getParent() != null) {
  
              if (parent instanceof JInternalFrame || parent instanceof JRootPane) {
                  break;
              }
  
              parent = parent.getParent();
          }
  
          Component[] cArray = null;
  
          if (parent != null) {
  
              if (parent instanceof JInternalFrame) {
                  cArray = ((JInternalFrame) parent).getContentPane().getComponents();
              } else if (parent instanceof JRootPane) {
                  cArray = ((JRootPane) parent).getContentPane().getComponents();
              }
          }
  
          if (cArray != null) {
  
              for (Component comp : cArray) {
  
                  if (comp instanceof JToolBar) {
  
                      if (comp != c && isNorthState.isInState((JComponent) comp)) {
                          return true;
                      }
                  }
              }
          }
  
          return false;
      }
docs: {@inheritDoc}