title: Create a tree graph in java using Jung
body: <p>I implement a graph algorithm and I have to make an interface for it. A frame with every step. I will do it manually.
  I use the Jung package but I can't figure out how to make that graph to look like a tree. I'm struggling for two days.</p>
  
  <p>Here is my attempt:</p>
  
  <pre><code>DirectedSparseGraph&lt;String, ?&gt; g = new DirectedSparseGraph&lt;String, Object&gt;();
  
          g.addVertex("ROOT");
          g.addVertex("A");
          g.addVertex("B");
          g.addVertex("C");
          g.addVertex("D");
          g.addVertex("E");
           VisualizationImageServer vv = new VisualizationImageServer(new CircleLayout(g), new Dimension(350, 300));  
  
  
          JFrame frame = new JFrame("First step");
  
          frame.getContentPane().add(vv);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.pack();
          frame.setVisible(true);
  </code></pre>
  
  <p>There I used CircleLayout, I should use TreeLayout but I have to implement Forest interface and I don't know how, I'm not a bright programmer. :(</p>
  
  <p>I want my graph to look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/UzhJ0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UzhJ0.png" alt="Desire result"></a></p>