Hi, I agree with Thomas.
But If you don't have problems creating a composite with a fix size and then resize it as soon as the svg document has been loaded on the JSVGCanvas, you can add a GVTTreeBuilderListener to your instance of the JSVGCanvas, and resize the container as part of the gvtBuildCompleted method of the listener. Hope this helps Abraham On Tue, Jun 2, 2009 at 5:16 AM, <[email protected]> wrote: > I build a DOM on the fly and do this: > > //myDoc that has been built on the fly. > > myJSVGCanvas.setDocument(myDoc); > > //Add the myJSVGCanvas into a JSVGScrollPane, add the JSVGScrollPane into a > JPanel, and display it in a JFrame. > > No matter how I resize the frame, the scroll bars will never show up. > > But if I save the myDoc into a file after I build the doc and load the file > back to the myJSVGCanvas, scrolling works like a charm. Something like this: > > //The same myDoc is saved to a file at theFilePath. > > myJSVGCanvas.loadSVGDocument(theFilePath) > > //The rest is same as the above. > > > How can I make the former work? > > >
