agentTree.getModel().addTreeModelListener(this);
  public void update() {    if (experiment.getSocietyComponentCount() != 0)      societyComponent = experiment.getSocietyComponent(0);    else      societyComponent = null;    hostTree.getModel().removeTreeModelListener(this);    nodeTree.getModel().removeTreeModelListener(this);    removeAllChildren(hostTree);    removeAllChildren(nodeTree);    removeAllChildren(agentTree);    DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();    if (!isEditable) {      renderer.setTextNonSelectionColor(Color.gray);      renderer.setTextSelectionColor(Color.gray);    }    hostTree.setCellRenderer(renderer);    nodeTree.setCellRenderer(renderer);    agentTree.setCellRenderer(renderer);    hostTree.setEditable(isEditable);    nodeTree.setEditable(isEditable);    agentTree.setEditable(isEditable);    // get hosts, agents and nodes from experiment    addHostsFromExperiment();    // create new host components for hosts named in config file    addHostsFromFile();    // add unassigned nodes to nodes tree    addUnassignedNodesFromExperiment();    // add unassigned agents to agents tree    addUnassignedAgentsFromExperiment();    // fully expand trees    expandTree(hostTree);    expandTree(nodeTree);    expandTree(agentTree);    hostTree.getModel().addTreeModelListener(this);    nodeTree.getModel().addTreeModelListener(this);  }