Graphstream Project looks incredible and is open source. The best about it, it's not Swing based:
Graphstream Project
Github Link
Graph graph = new SingleGraph("Tutorial 1");
graph.setStrict(false);
graph.setAutoCreate(true); // optionally have it create nodes for you automatically
graph.addEdge("AB", "A", "B");
graph.addEdge("BC", "B", "C");
graph.addEdge("CA", "C", "A");
graph.display();
Or a tree: