I am trying to use the JUNG library to visualise a basic graph with vertices and edges. Using the example code on the website, I have the following:
import edu.uci.ics.jung.graph.DirectedSparseGraph;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.UndirectedSparseGraph;
import java.util.*;
public class GraphTest {
public GraphTest(){
Graph g = new DirectedSparseGraph();
Vertex v1 = (Vertex) g.addVertex(new DirectedSparseVertex());
Vertex v2 = (Vertex) g.addVertex(new DirectedSparseVertex());
}
However, "Vertex" is underlined in red and Netbeans is telling me it cannot find symbol. I tried importing what Netbeans suggested but to no avail, and now I believe that Vertex is actually native to Java. I've no idea where I'm going wrong but I think it's an elementary error that is escaping me.