Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.NoClassDefFoundError: org/w3c/dom/svg/SVGDocument

843836Mar 8 2005 — edited Mar 8 2005
Hi,

Iam new to this SVG ? I have an batik API and when i am running the following programe it will give above Exception..

plz help where can get that API


DOMImplementation impl = GenericDOMImplementation.getDOMImplementation();
String svgNS = "http://www.w3.org/2000/SVG";//SVGDOMImplementation.SVG_NAMESPACE_URI;
Document doc = impl.createDocument(svgNS, "svg", null);

// get the root element (the svg element)
Element svgRoot = doc.getDocumentElement();

// set the width and height attribute on the root svg element
svgRoot.setAttributeNS(null, "width", "400");
svgRoot.setAttributeNS(null, "height", "450");

// create the rectangle
Element rectangle = doc.createElementNS(svgNS, "rect");
rectangle.setAttributeNS(null, "x", "10");
rectangle.setAttributeNS(null, "y", "20");
rectangle.setAttributeNS(null, "width", "100");
rectangle.setAttributeNS(null, "height", "50");
rectangle.setAttributeNS(null, "style", "fill:red");

// attach the rectangle to the svg root element
svgRoot.appendChild(rectangle);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2005
Added on Mar 8 2005
2 comments
1,421 views