title: Prefuse Toolkit: dynamically adding nodes and edges
body: <p>Does anyone have experience with the prefuse graph toolkit? Is it possible to change an already displayed graph, ie. add/remove nodes and/or edges, and have the display correctly adapt? </p>
  
  <p>For instance, prefuse comes with an example that visualizes a network of friends:</p>
  
  <blockquote>
    <p><a href="http://prefuse.org/doc/manual/introduction/example/Example.java" rel="nofollow noreferrer">http://prefuse.org/doc/manual/introduction/example/Example.java</a></p>
  </blockquote>
  
  <p>What I would like to do is something along the lines of this:</p>
  
  <pre><code>// -- 7. add new nodes on the fly -------------------------------------
  new Timer(2000, new ActionListener() {
      private Node oldNode = graph.nodes().next(); // init with random node
  
      public void actionPerformed(ActionEvent e) {
          // insert new node //
          Node newNode = graph.addNode();
  
          // insert new edge //
          graph.addEdge(oldNode, newNode);
  
          // remember node for next call //
          oldNode = newNode;
      }
  }).start();
  </code></pre>
  
  <p>But it doesn't seem to work. Any hints?</p>