title: Display updated tree table value from another tree table
body: <p>I am trying to make a scene editor to go with my rendering engine. I am using swing to make the GUI and also swingx for its <code>JXTreeTable</code> component. Everything is working fine, except that the Scene tree table is not updating the names of the nodes automatically as I would like. For example, in the next image, I change the name of one of the nodes, and nothing seems to happen. However if I then move my mouse over the node in the Scene box (the one at the top) the name gets updated.</p>
  
  <p><img src="https://i.stack.imgur.com/rXy2c.png" alt="enter image description here"></p>
  
  <p>I have two <code>JXTreeTable</code>, and two models which extend <code>AbstractTreeTableModel</code>.
  Here is the relevant code for the Properties model.</p>
  
  <pre><code>public class PropertiesModel extends AbstractTreeTableModel{
      private EE_Property root;
      private SceneModel mSceneModel;
      private EE_SceneObject sceneSelection;
  
      ...
  
      @Override
      public void setValueAt(Object value, Object node, int column){
          ((EE_Property)node).setValue((String)value);
  
          // Updates the values of the current scene selection
          sceneSelection.setProperties(root);
  
          TreePath path = new TreePath(sceneSelection.getParent());
          int index = mSceneModel.getIndexOfChild(sceneSelection.getParent(), sceneSelection);
  
          // This is where I thought the updating of the scene model would happen and thus redraw it correctly
          mSceneModel.getTreeModelSupport().fireChildChanged(path, index, sceneSelection);
      }
  }
  </code></pre>
  
  <p>I thought that using <code>fireChildChanged()</code> would update the scene tree table as I wanted.</p>
  
  <p>If I call <code>fireChildChanged()</code> with index=0, I can get the Root node to update when I rename it, but any other index I have to wait till I move the mouse over it to update.</p>
  
  <p><strong>Edit: problem solved</strong></p>
  
  <p>I tried the redraw method suggested by @Shakedown which partially worked but sometimes would leave "..." after the text if the new text was longer than the original.</p>
  
  <p>I did however realize that the problem was coming from the TreePath not being generated properly. When using <code>TreePath path = new TreePath(sceneSelection.getParent());</code>, the path's parent was null, thus not allowing the tree to update. I now use this code which works :</p>
  
  <pre><code>// mTT is the scene tree table
  TreePath nodePath = mSceneModel.mTT.getTreeSelectionModel().getSelectionPath(); 
  int index = mSceneModel.getIndexOfChild(sceneSelection.getParent(), sceneSelection);
  mSceneModel.getTreeModelSupport().fireChildChanged(nodePath.getParentPath(), index, sceneSelection);
  </code></pre>