1

I use JUNG framework to build my Semantic Tree and I have a big problem cause my Tree is very large and i need and scroll bars. I've found somewhere that GraphZoomScrollPane is the best option to do this, but when i try to render my graph using this class the content doesnt render.

When I set JPanel with VisualizationViewer object everything works fine but when I wrap VisualizationViewer in GraphZoomScrollPane and then set JPanel with wrapper it doesn't work.

Layout layout = new TreeLayout(ftb.getGraph());
server = new VisualizationViewer<String, FinalTreeNode>(
Panel panel=server;

It works and I see my graph in JPanel.

Layout layout = new TreeLayout(ftb.getGraph());
server = new VisualizationViewer<String, FinalTreeNode>(layout);
GraphZoomScrollPane gzsp = new GraphZoomScrollPane(server);
Panel panel =  gzsp;

It doesn't work. I don't see my graph and scrollbras.

Thera are no Exceptions. Can abody help me ? Because I've tried almost everything and it doesn't work. I'm runnig out of time.

  • If you want an answer to your question, you need to do two things: (1) pare down your example to the smallest thing that will show the problem (not ~200 lines of code for someone else to pore through), and (2) you need to specify exactly what your problem is. "It doesn't work" is not helpful. Do you get an exception? If so, what's the stack trace? Do you see something other than what you're expecting? If so, what are you expecting and what do you see? Are you seeing any console output? Etc. – Joshua O'Madadhain Jul 15 '15 at 05:32

1 Answers1

0

Why not adding the GraphZoomScrollPane as a component inside your JPanel?

panel = new JPanel(new BorderLayout());
panel.add(gzsp, BorderLayout.CENTER);
panel.updateUI();
Mohammed
  • 134
  • 6