Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Jung-related problem

807589Dec 1 2008 — edited Dec 10 2008
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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 7 2009
Added on Dec 1 2008
6 comments
91 views