0

I am using JUNG to generate some graphs, however I found something weird with the final product where the graph does not paint anything after I click the button to execute on the given data. But it will show up after I resize the frame, or after I click on maximize.

I re-use Tom Nelson's sample code and enhance it a little bit to be able to read input data from database. It has >1k line of codes and am unsure how to paste my code here to give the actual example.

here is the original code: http://logic.cse.unt.edu/tarau/teaching/GraphTheory/jung/src/jung2/jung-samples/src/main/java/edu/uci/ics/jung/samples/EdgeLabelDemo.java

Any advise?

lagunaloire
  • 81
  • 3
  • 9
  • Hard to tell without seeing the code. The original code does not have the described behaviour. You are most likely modifying the `VisualizationViewer` after making it visible and you are not calling for a `repaint()` – Moh-Aw Apr 18 '16 at 08:20
  • Hi @Moh-Aw, quite difficult for me to prepare the dummy code of my case as it is fully integrated and linked to many objects outside current however, on this button will trigger lines of code as below after the data returned. graph.addEdge(":"+String.valueOf(i)+":"+listedValueOnArray[1], listedValueOnArray[0], listedValueOnArray[2]); vv.repaint(); – lagunaloire Apr 18 '16 at 09:05

0 Answers0