Guys, I have a menu with sub menus, when I mouse over menu, the sub menu displays, but when mouse out, it stays like that and wont disappear. I am not sure how fix this issue.
this is my code.

@Override
protected void onMouseOver(ComponentEvent ce)
{
hideAll();

super.onMouseOver(ce);
if(!disabled)
{
if(menu != null && !menu.isVisible())
{
showMenu();
menu.setActiveItem(menu.getItem(0), true);
}
}
}

@Override
protected void onMouseOut(ComponentEvent ce)
{
super.onMouseOut(ce);

if(!disabled)
{
if(menu != null && menu.isVisible() && !menuItemActive)
{
hideMenu();
}
}

}

I changed/removed the menuItemActive boolean, but then I cant select sub menus, it disappears as soon as I mouse out menu. I want it to disappear only if menu/submenus are not mouser overed.

Please help.