visualization problem

2006-08-23
2013-05-29
  • Nobody/Anonymous

    hi all

    im applying the following simple code  to visualize my graph

    JungGraph t = new JungGraph();
            t.addVertices();
            t.addEdges();
           
            Layout l = new FRLayout( t );
            Renderer r = new PluggableRenderer();
            VisualizationViewer vv = new VisualizationViewer( l, r );
            JFrame jf = new JFrame();
            jf.getContentPane().add ( vv );

    but the compiler doesn't like it giving me the following exception

    Exception in thread "main" java.lang.NoClassDefFoundError: cern/jet/random/engine/RandomEngine
            at edu.uci.ics.jung.visualization.AbstractLayout.initialize(AbstractLayout.java:104)
            at edu.uci.ics.jung.visualization.DefaultVisualizationModel.setGraphLayout(DefaultVisualizationModel.java:127)
            at edu.uci.ics.jung.visualization.DefaultVisualizationModel.<init>(DefaultVisualizationModel.java:82)
            at edu.uci.ics.jung.visualization.DefaultVisualizationModel.<init>(DefaultVisualizationModel.java:66)
            at edu.uci.ics.jung.visualization.VisualizationViewer.<init>(VisualizationViewer.java:170)

    can anyone explain why?, and what does this exception stand for ( cern/jet/random etc..!)

    kind regards
    Moe

     
    • Tom Nelson

      Tom Nelson - 2006-08-23

      jung depends on the colt library, and the commons-collections
      library.
      Please revisit the download page and follow the
      instructions to download what is needed to use jung.

      Tom Nelson

       
    • Nobody/Anonymous

      You have to make sure that you import all the jar files needed into your library

       
    • moody

      moody - 2006-08-25

      i'd like to thank you all for your help.

      i added the required libraries, the code compiled
      with no syntax errors, however when i run it
      i can't see any display of the graph in the JFrame.

      can you tell me what is missing?
      regards
      Moe
      here is the code :

        Layout l = new FRLayout( t );
              Renderer r = new PluggableRenderer();
              VisualizationViewer vv = new VisualizationViewer( l, r );
             
              JFrame jf = new JFrame("test");
              jf.setSize(600, 600);
              jf.getContentPane().add ( vv );
            
             jf.setVisible(true);
             jf.setDefaultCloseOperation(jf.EXIT_ON_CLOSE);

       
      • Joshua O'Madadhain

        This may sound like a silly question, but are you sure that the graph is non-empty?  (Check the return values for numVertices() and numEdges().)

        Joshua

         
        • Nobody/Anonymous

          you are right it is silly and stupid  asd well.

            i found the mmistake, the graph was empty!

          thanks :P

           

Log in to post a comment.