title: Draw a graph in a JFrame with GraphStream
body: <p>I am trying to create a graph using the GraphStream API. I want to add some visual effects on top of the graph Layout drawn with the API, so I plan to embed the graph in a JFrame.</p>
  
  <p>I read this post here (<a href="https://stackoverflow.com/questions/28219903/how-to-draw-graph-inside-swing-with-graphstream-actually">How to draw graph inside swing with GraphStream actually?</a>), to look some implementations, but I am always getting an exception error:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: org/graphstream/ui/swingViewer/Viewer, method: addDefaultView signature: (Z)Lorg/graphstream/ui/swingViewer/View;) Incompatible argument to function
  at ShowGraph$MyFrame.&lt;init&gt;(ShowGraph.java:17)
  at ShowGraph$1.run(ShowGraph.java:34)
  at java.awt.event.InvocationEvent.dispatch(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$500(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)
  </code></pre>
  
  <p>The code used is the same as the one in the link:</p>
  
  <pre><code>public class ShowGraph
  </code></pre>
  
  <p>{</p>
  
  <pre><code>private static Graph graph = new SingleGraph("Graph");
  
  public static class MyFrame extends JFrame
  {
      private static final long serialversionUID = 8394236698316485656L;
      private Viewer viewer = new Viewer(graph,Viewer.ThreadingModel.GRAPH_IN_ANOTHER_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() {
  
              graph.addNode("A");
              graph.addNode("B");
              graph.addNode("C");
              graph.addEdge("AB", "A", "B");
              graph.addEdge("BC", "B", "C");
              graph.addEdge("CA", "C", "A");
  
              MyFrame frame = new MyFrame();
              frame.setSize(320, 240);
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
  
          }
      });
  }
  </code></pre>
  
  <p>}</p>