954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to graphically represents a network?which classes to use?

Hello,

I have written some java classes to generate a random network.
The network is made of : 200 nodes . Each node has a maximum of 50 neighbors.
What i want is to Randomly chose a node from that network and GRAPHICALLY show it with its one hop neighbors and its second hop neighbors.
I have these information saved in the code since each Node has 2 arraylists, one to save its one hop neighbors, and another to save it second hop neighbors. I have never used java to draw before, can you please tell me what classes i should use in order to get what i want ? thank you :)

wonder_laptop
Junior Poster in Training
89 posts since Aug 2007
Reputation Points: 25
Solved Threads: 0
 

Look at the example inside java jdk package jdk1.7.0/demo/applets/GraphLayout/example4.html Earlier versions also include this example.

quuba
Posting Pro
573 posts since Nov 2008
Reputation Points: 123
Solved Threads: 106
 

If it would work for you to get a jpeg (or other format) displaying the graphs, consider using the DOT language.

villadsen
Newbie Poster
2 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

i dont want to use another language ..id rather code in java

wonder_laptop
Junior Poster in Training
89 posts since Aug 2007
Reputation Points: 25
Solved Threads: 0
 

You need to come up with a design of display first. Then you can aim to create a graphic for it. You could simply use 2D graphic to display which is not difficult to do. The main issue for you is how you want it to be presented. What constraint of display in term of size of display, layout, etc. Programming part for this graphic display is not that important.

Taywin
Posting Virtuoso
1,727 posts since Apr 2010
Reputation Points: 229
Solved Threads: 239
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: