DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)tree.getSelectionPath().getLastPathComponent(); ConsoleTreeObject cto = (ConsoleTreeObject)selectedNode.getUserObject(); ConfigurableComponent component = (ConfigurableComponent)cto.getComponent(); component.addProperty(name, value);
TreePath[] selectedPaths = tree.getSelectionPaths(); for (int i = 0; i < selectedPaths.length; i++) { DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)selectedPaths[i].getLastPathComponent(); ConsoleTreeObject cto = (ConsoleTreeObject)selectedNode.getUserObject(); ConfigurableComponent component = (ConfigurableComponent)cto.getComponent(); component.addProperty(name, value); }
  private void setPropertyOfNode(JTree tree, String name, String value) {    DefaultMutableTreeNode selectedNode =      (DefaultMutableTreeNode)tree.getSelectionPath().getLastPathComponent();    ConsoleTreeObject cto = (ConsoleTreeObject)selectedNode.getUserObject();    ConfigurableComponent component =       (ConfigurableComponent)cto.getComponent();    component.addProperty(name, value);  }