title: Determine if node was deleted in JTree
body: <p>Right now, I have a <code>TreeSelectionListener</code> on my <code>JTree</code>. This works fine. However, I need to detect the case that a node has been deleted. I am not sure how to do this using a TreeSelectionEvent.</p>
  
  <p>I haven't seen anything in the JavaDoc about it. I was looking for something analogous to a <code>TableModelEvent</code> where it has a <code>getType()</code> method that allows you to know if something was updated,deleted, or inserted into the table. Any idea how this can be detected?</p>
  
  <p>I can't use a TreeModelListener, because when I call:</p>
  
  <pre><code>((DefaultTreeModel)getModel()).removeNodeFromParent(node);
  </code></pre>
  
  <p>On my tree, it triggers the <code>valueChanged(TreeSelectionEvent)</code> to be fired. This is what I am trying to escape from.</p>
  
  <p>Something like:</p>
  
  <pre><code>public void valueChanged(TreeSelectionEvent treeSelectionEvent){
      if(treeSelectionEvent.someMethod()){ &lt;----need this
          return;
      }
  }
  </code></pre>