I build some CommandGroups in menubar ui.There is a timer to change CommandGroup visible/unvisible state every 10 seconds.But when the state changes unvisible to visible, the CommandGroup menu will display on the top-left corner and can not been hidden.

The codes are as follows:

CommandGroup c = (CommandGroup) Application.instance().getActiveWindow().getComman dManager().getCommand("XXXMenu");


Timer code...
....

c.setVisible(!c.isVisible());
...

I have read the source code in CommandGroup.java, perhaps the bug is generated by "setVisible" method:

public void setVisible(boolean visible) {
super.setVisible(visible);
getMemberList().setContainersVisible(visible);// If super changes to visible, the MemberList Menuwill also change to visible and show on the top-left corner.
}

Can you help me?