Yes, I installed the crimson in jdk1.3.1_04\jre\lib\ext directory. I changed the svg file from (batik/samples/)anne.svg to simple rectangle drawing. The error didn't occur and the file was displayed. I don't understand because it was successful to show the anne.svg on JSVGCanvas sample application. Are there any differences between applet and application in JSVGCanvas?
Thanks. Hideyoshi > -----Original Message----- > From: Vincent Hardy [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 05, 2002 1:47 AM > To: Batik Users > Subject: Re: JSVGCanvas on applet > > > Hideyoshi, > > Did you check that your have crimson in your classpath when you run > appletviewer? > > Vincent. > > Hideyoshi Yanagisawa wrote: > > Hello, > > > > I am intrested in JSVGCanvas to draw svg file on applet. > > I have written a simple applet code and compiled it. > > Compile was successful. But I got a error when I ran it with > > appletviewer. I have set the java.policy file to permit to read a > > local file. > > > > Thank you. > > > > > > [c:/java/svgapplet/svgApplet.java] > > > > import java.awt.*; > > import java.awt.event.*; > > import java.net.*; > > import java.io.*; > > import java.applet.*; > > import javax.swing.*; > > import org.apache.batik.swing.*; > > > > public class svgApplet extends JApplet { > > public void init() { > > JSVGCanvas svgCanvas = new JSVGCanvas(); > > File f = new File("c:/java/svgapplet/anne.svg"); > > try {svgCanvas.setURI(f.toURL().toString());} > > catch (IOException ex) {ex.printStackTrace();} > > getContentPane().add(svgCanvas); > > } > > } > > > > [C:/j2sdk1.4.0/jre/lib/security/java.policy] > > > > grant codeBase "file:/c:/java/svgapplet/" { > > permission java.io.FilePermission "*","read"; > > }; > > > > [c:/java/svgapplet/svgApplet.html] > > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" > > "http://www.w3.org/TR/REC-html40/frameset.dtd";> > > <!--NewPage--> > > <HTML> > > <HEAD><TITLE>test</TITLE></HEAD> > > <BODY BGCOLOR="white"> > > <APPLET archive="svgApplet.jar" code="svgApplet.class" > > width=600 height=600 ></APPLET> > > </CENTER> > > </BODY> > > </HTML> > > > > [Error] > > java.io.IOException: java.lang.NullPointerException > > at > org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown > > Source) > > at > org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown > > Source) > > at > org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown Source) > > at org.apache.batik.swing.svg.SVGDocumentLoader.run(Unknown Source) > > > > > > Yanagisawa > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
