A project that I am working on requires me to show the network layout when the user clicks on a button on a GUI panel “Show Network Layout”.
Example: X is the name of a sub-network and x1, x2, x3 are the connected devices.
Similarly, Y is the name of a sub-network and y1, y2, y3 are the connected devices and so on.
How they are connected to each other and in which direction is defined in a flat file.
This is how the image should look:
Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]
The question is what is the best way I can do this using Java. Am not asking for the programming part but what Java tool can be used to accomplish this. A sample example would be really helpful.
Thanks
Since your sample picture is a directed graph, JGraph would be a nice tool to use. An other great option is JGraphT. Both links have sample code. The second link uses an applet, so you can see directly the graph and the necessary code, in order to create it. JGraph is very similar.