return fMenus.indexOf(fSelectedMenu);
    public int getSelectedIndex()    {        if (fSelectedMenu != null)        {            if (fSelectedMenu instanceof SMenuItem)            {                for (int m = 0; m < getMenuCount(); m++)                {                    SMenu menu = getMenu(m);                    for (int mi = 0; mi < menu.getMenuComponentCount(); mi++)                    {                        if (menu.getMenuComponent(mi).equals(fSelectedMenu))                            return m;                    }                }                return -1;            }            return fMenus.indexOf(fSelectedMenu);        }        return -1;    }