Hi,
I have successfully managed to import an SVG graphic/file into an
application but when trying to import an SVG graphic into an applet
I am having some problems.
Here�s the code for my applet:
import org.apache.batik.swing.*;
import org.apache.batik.swing.JSVGCanvas;
import org.apache.batik.svggen.*;
import
org.apache.batik.dom.svg.SVGDOMImplementation;
import org.w3c.dom.*;
import org.w3c.dom.svg.*;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class TestSVGInApplet extends JApplet
{
public void init()
{
DOMImplementation impl =
SVGDOMImplementation.getDOMImplementation();
String svgNS =
SVGDOMImplementation.SVG_NAMESPACE_URI;
SVGDocument doc =
(SVGDocument)impl.createDocument(svgNS, "svg",
null);
Container c = getContentPane();
//Now, display the document
JSVGCanvas canvas = new JSVGCanvas();
canvas.setURI("http://localhost:8081/SVGImages/In
tro.svg");
c.add(canvas);
}
}
When I run the corresponding HTML page (with the applet
embedded using the <APPLET> tags) I get this error:
java.lang.NoClassDefFoundError:
org/apache/batik/swing/JSVGCanvas
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown
Source)
at sun.plugin.AppletViewer.createApplet(Unknown
Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I had no problems getting the SVG graphic to view in the
application (server was running but the application was run from the
command line). However, when I run the above code on Tomcat it
causes the above error. Any ideas? How do you get the SVG file to
work in an applet running on Tomcat? Any help would be great.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]