title: How to draw graph inside swing with GraphStream actually?
body: <p>I am trying to implement drawing of <a href="http://graphstream-project.org/doc/Tutorials/Graph-Visualisation_1.1/#integrating-the-viewer-in-your-gui" rel="nofollow noreferrer">tutorial graph inside swing</a>, but failing.</p>
  
  <p>The code is follows:</p>
  
  <p>package tests.graphstream;</p>
  
  <pre><code>import java.awt.BorderLayout;
  import javax.swing.JFrame;
  import javax.swing.SwingUtilities;
  import org.graphstream.graph.Graph;
  import org.graphstream.graph.implementations.SingleGraph;
  import org.graphstream.ui.swingViewer.View;
  import org.graphstream.ui.swingViewer.Viewer;
  
  public class Tutorial1_01
  {
      private static Graph graph = new SingleGraph("Tutorial 1");
  
      public static class MyFrame extends JFrame
      {
          private static final long serialVersionUID = 8394236698316485656L;
  
          //private Graph graph = new MultiGraph("embedded");
          //private Viewer viewer = new Viewer(graph, Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
          private Viewer viewer = new Viewer(graph, Viewer.ThreadingModel.GRAPH_IN_SWING_THREAD);
          private View view = viewer.addDefaultView(false);
  
          public MyFrame() {
               setLayout(new BorderLayout());
               add(view, BorderLayout.CENTER);
               setDefaultCloseOperation(EXIT_ON_CLOSE);
          }
      }
  
      public static void main(String args[]) {
          SwingUtilities.invokeLater(new Runnable() {
              public void run() {
                  MyFrame frame = new MyFrame();
                  frame.setSize(320, 240);
                  frame.setLocationRelativeTo(null);
                  frame.setVisible(true);
  
                  graph.addNode("A");
                  graph.addNode("B");
                  graph.addNode("C");
                  graph.addEdge("AB", "A", "B");
                  graph.addEdge("BC", "B", "C");
                  graph.addEdge("CA", "C", "A");
  
                  graph.addAttribute("ui.quality");
                  graph.addAttribute("ui.antialias");
              }
          });
      }
  }
  </code></pre>
  
  <p>And it draws this:</p>
  
  <p><img src="https://i.stack.imgur.com/meXrf.png" alt="enter image description here"></p>
  
  <p>If drag nodes, it turns to:</p>
  
  <p><img src="https://i.stack.imgur.com/mfvt8.png" alt="enter image description here"></p>
  
  <p>How to get results, close to <code>graph.display()</code>?</p>