title: Changing the Node image of a JTree dynamically
body: <p>I am using a CustomCellRenderer to display nodes of a JTree to display image with a node as
  shown below :-</p>
  
  <pre><code>class CustomTreeCellRenderer extends DefaultTreeCellRenderer{
  
      public Component getTreeCellRendererComponent(JTree tree,
          Object value, boolean selected, boolean expanded,
          boolean leaf, int row, boolean hasFocus){
  
          super.getTreeCellRendererComponent(tree, value,
          selected, expanded, leaf, row, hasFocus);
  
          JLabel label = (JLabel) this ;
  
          label.setIcon( new ImageIcon("white.png") ) ;
  
          return this;
      }
  }
  </code></pre>
  
  <p>My requirement is to change image of the node on some external action.
  I am trying to reload the model of JTree, but it's not working as shown below :-</p>
  
  <pre><code>public void actionPerformed(ActionEvent ae) {
  
          DefaultTreeModel model = (DefaultTreeModel) tree.getModel() ;
  
          JLabel label = (JLabel) tree.getCellRenderer() ;
          System.out.println(label.getIcon()); //displaying white.png
  
          label.setIcon( new ImageIcon("black.gif") ) ;
  
  
          model.reload() ;
      }
  </code></pre>
  
  <p>Where I am doing wrong??????</p>