I'm trying to add a label to my graph, but can't get it out of the default center position. This is what I have right now in my update method (it refreshes the display):
Graph<String, String> graph = getGraph();
BasicVisualizationServer<String, String> vv = getViewer(graph);
frame.getContentPane().removeAll();
frame.getContentPane().add(vv);
JLabel label = new JLabel("<html>ndp: blue<br>mdp: dark green</html>", JLabel.LEFT);
vv.add(label);
frame.pack();
It shows the label, but won't put it on the left no matter what I attach the label to or how I specify that it should be left... What am I doing wrong?