title: JTree custom model adding/removing/changing nodes
body: <p>I got such a trouble. I have an overlay database structure and use JTree to display the items. Here's my simplified view of model:</p>
  
  <pre><code>public class MenuTreeModel implements TreeModel {
  private MenuList ml;
  
  public MenuTreeModel( MenuList ml ) {
      this.ml = ml;
  }
  
  @Override
  public void addTreeModelListener(TreeModelListener l) {
  
  }
  
  @Override
  public Object getChild(Object parent, int index) {
      if ( parent.getClass().hashCode() == MenuList.class.hashCode() ){
          return ((MenuList) parent).getStation(index);
      }
      if ( parent.getClass().hashCode() == MenuStations.class.hashCode() ){
          return ((MenuStations) parent).get(index);
      }
      return null;
  }
  
  @Override
  public int getChildCount(Object parent) {
      if ( parent.getClass().hashCode() == MenuList.class.hashCode() ){
          return ((MenuList) parent).getSize();
      }
      if ( parent.getClass().hashCode() == MenuStations.class.hashCode() ){
          return ((MenuStations) parent).getSize();
      }
      return 0;
  }
  
  @Override
  public int getIndexOfChild(Object parent, Object child) {
      if ( parent.getClass().hashCode() == MenuList.class.hashCode() ){
          return ((MenuList) parent).getIndexOf((MenuStations) child);
      }
      if ( parent.getClass().hashCode() == MenuStations.class.hashCode() ){
          return ((MenuStations) parent).getIndexOf((MenuCats) child);
      }
      return 0;
  }
  
  @Override
  public Object getRoot() {
      return ml;
  }
  
  @Override
  public boolean isLeaf(Object node) {
      return node.getClass().hashCode() == MenuCats.class.hashCode();
  }
  
  @Override
  public void removeTreeModelListener(TreeModelListener l) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void valueForPathChanged(TreePath path, Object newValue) {
      // TODO Auto-generated method stub
  
  }
  </code></pre>
  
  <p>And when I remove something from <strong>ml</strong> or its inner items, the tree structure does not change. I couldn't find any method like <strong>fireTreeModelChanged</strong>.</p>