g.addEdge("is a", "C++", "Programming Language");
g.addEdge("is a", "Perl", "Programming Language");
g.addEdge("is a", "Python", "Programming Language");
NanoGraphPanel gp = new NanoGraphPanel();
DebugGraphListener dgl = new DebugGraphListener(new OutputStreamWriter(System.out));
gp.getInteractionManager().addSelectionListener(dgl);
gp.setModel(g);
gp.getNanoGraph().setLayout(new CircularLayoutAlgorithm(200));
gp.getNanoGraph().setBackground(new GridBackGround());
DefaultNodeRenderer r = new DefaultNodeRenderer();
r.setBodyColor(new GradientPaint(0,0,Color.YELLOW, 600, 600,Color.RED));
gp.getNanoGraph().registerNodeRenderer(String.class, r);
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(gp);