else { MenuElement[] subElements2 = new MenuElement[j]; for (int i = 0; i < j; i++) subElements2[i] = subElements[i];  return subElements2; }
  public MenuElement[] getSubElements()  {    MenuElement[] subElements = new MenuElement[getComponentCount()];    for (int i = 0; i < getComponentCount(); i++)      subElements[i] = (MenuElement) getMenu(i);    return subElements;  }