xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Hardy <vincent.ha...@sun.com>
Subject Re: JSVGCanvas on applet
Date Thu, 05 Sep 2002 08:46:40 GMT
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: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message