Alex Rivera | Logout

Drawing graphs on java

Asked 2010-06-05T19:48:59.497
23

I want to draw graphs (nodes and edges) in Java. However, since I don't know how to go about it, I would like to have some advice before starting.

How should I do this?

use Graphics2D package, right?

How about the labels for the nodes? should I use something like drawString and handle all the "centering" manually or create a JLabel for that? Can I put a JLabel on a Graphics2D environment?

I have searched but haven't found any simple implementation of this. If you know of one, please provide the link in your answer.

edit: The solution I am looking for should be able to remove nodes, drag nodes, edit labels, create nodes, all with mouse events.

Thanks.

Edit
Report

1 Answer

10

Perhaps this will help: JUNG.

And you will probably need to read this: http://jung.sourceforge.net/doc/JUNGVisualizationGuide.html

answered 2010-06-05T19:53:05.090

Your Answer