I've not tried this before, so I may be doing something wrong.
The complete example is below. It consistently fails.
import javax.swing.*; import javax.xml.parsers.*; import java.awt.*; import java.io.*; import java.net.*;
import org.w3c.dom.*; import org.apache.batik.swing.JSVGCanvas;
public class batiktest
{
private final static String FILE = "barChart.svg"; // any example file
public static void main(String args[])
throws Exception
{
// load xml
URL url = new File(FILE).toURL();
InputStream is = new BufferedInputStream(url.openStream());;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(false);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
Document doc = docBuilder.parse(is);
is.close();
JSVGCanvas svgCanvas = new JSVGCanvas();
// if this line isn't present, another error is generated
// (ant it is not caught by the user agent)
svgCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC); svgCanvas.setDocument(doc);
JFrame frame = new JFrame("XML Input Example");
frame.setResizable(true);
frame.setSize(new Dimension(500,500));
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.getContentPane().add(svgCanvas);
frame.setVisible(true);
}// main()
}// class baitktest
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]