Hi,

I'm trying to add a JSVGCanvas to a JScrollPane, which is then added to a
JSplitPane. The other pane contains a JTree. Actually, at one point I had
this working, but then I split up the single large file/class into some more
logical files/classes, and it no longer works.


I've checked that the SVG file actually exists, and it views fine in IE.
Also, I put it in a directory whose path contains no spaces.

This reports that the file exists: System.out.println("file exists: " +
svgf.exists());

However, after making the JSVGCanvas, this line reports that it is invalid:

   System.out.println("svgcanvas: " + svgCanvas.isValid() + " (valid)  " +
svgCanvas  );

There is so little code involved here, I can't imagine what is going wrong.

Any advice will be greatly appreciated.

(The code is below.)

Jane


public class SVGDisplay extends JScrollPane{
     Mediator med;
     JSVGCanvas svgCanvas;


public SVGDisplay(String  f, Mediator m) {
    med = m;
    File svgf = new File(f);
    System.out.println("file exists: " + svgf.exists());
    JSVGCanvas svgCanvas = new   JSVGCanvas();
     try{
    System.out.println("svg url: " + svgf.toURL().toString());
    svgCanvas.setURI(svgf.toURL().toString());
        } catch (IOException ex) {
                        ex.printStackTrace();
                   }
     System.out.println("svgcanvas: " + svgCanvas.isValid() + " (valid)  " +
svgCanvas  );
     this.add(svgCanvas) ;
     this.setPreferredSize(new Dimension( m.getRWidth(), m.getHeight()));

    }

//......


}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to