public void back() { MenuComponentComposite f = this.currentSelectedComponent.getFather(); if (f == this.menu.getChild(0)) { return; } try { if (!this.currentSelectedComponent.isExpanded() && this.currentSelectedComponent.hasFocus()) { this.currentSelectedComponent.setFocus(false); f.getFather().setExpanded(true); f.getFather().validate(); f.setExpanded(false); this.currentSelectedComponent = f; this.currentComponentIndex = this.componentsTraversedIndexes.Pop(); f.setFocus(true); // this.currentSelectedComponent.setFocus(true); } else { //should be a container expanded without child // Console.WriteLine("Closing container expanded without child"); this.currentSelectedComponent.setFocus(true); this.currentSelectedComponent.setExpanded(false); f.setExpanded(true); f.validate(); } } catch (NoChildException e) { } }