jung how to create a new vertex at new position

372 Views Asked by At

I am using circle layout in jung. On the click of button i am able to create a new node but it overlaps with the earlier one. Ever new node is getting generated at the same position. Please help me in dynamically allotting a location to newly created node

1

There are 1 best solutions below

0
On

CircleLayout is a static layout: if you add new vertices to the graph, you need to create a new CircleLayout instance.

Aside from that, I have no idea how you're assigning locations to vertices when you create them, but that's your code, not ours. :)