void (ActionEvent e) { final TreePath path = myWizardTree.getSelectionPath(); if (path != null && 0 == myWizardTree.getModel().getChildCount(path.getLastPathComponent())) { handleSelect(false, null); return; } oldExpandAction.actionPerformed(e); }