The following forum message was posted by yuruani at http://sourceforge.net/projects/jung/forums/forum/252062/topic/5897299:
Hi. I am creating a network with Jung using FRLayout and a DirectedSparseGraph.
The network first appears fine. Then I want to draw another network on
pressing a button.
The action is done like this:
Edges and vertices from the graph are removed from the graph, new vertices and
are created and added to it,
the container gets revalidated and the main content pane gets updated.
Once that happens, a new network appears, but this time there is
really no layout, everything
is spread randomly.
What am I doing wrong? Thanks
The following forum message was posted by e-flat at http://sourceforge.net/projects/jung/forums/forum/252062/topic/5897299:
You're not really giving enough detail about what you're doing to be sure.
Are you retaining the same Graph object?
Are you updating the layout?
Generally, I recommend looking at the AddNodeDemo for tips on how to update
the visualization as you're updating the graph.