Hi,
I am having some trouble regarding usage of Jung. Any help would be greatly appreciated!
For the following code, please assume that the Graph g is already created.
public void viewGraph(){
Layout <Integer, String> layout = new CircleLayout(g);
layout.setSize(new Dimension(350, 350));
BasicVisualizationServer <Integer, String> myServer = new BasicVisualizationServer<Integer, String> (layout);
myServer.setPreferredSize(new Dimension(300,300));
JFrame frame = new JFrame ("Normal Graph");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(myServer);
frame.pack();
frame.setVisible(true);
System.err.println("Normal Graph drawn.");
}
In the above code, the following line of code is not recognized in the IDE:
frame.getContentPane().add(myServer);
Could someone please tell me why this happens? I have all the necessary packages, etc imported.
Thanks!