Hi All Iam trying to add an element dynamically to the svgdocument bound to a JSVGCanvas. Iam doing this inside updatemanagerthread but it doesn't work. can anybody suggest what iam doing wrong here. The following code snippet is inside a dynamicUpdatebutton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent ae) { svgCanvas.getUpdateManager().getUpdateRunnableQueue ().invokeLater( new Runnable() { public void run() { SVGDocument svgdoc=svgCanvas.getSVGDocument(); Element elt = svgdoc.createElement("a"); elt.setAttribute("xlink:href","http://www.ibm.com/"); Element polygon = svgdoc.createElement("polygon"); polygon.setAttribute("points","60 160,165 172,180 60,290 290,272 280,172 285,250 255"); polygon.setAttribute("style","fill:dimgrey"); elt.appendChild(polygon); svgdoc.getRootElement().appendChild(elt); svgCanvas.setDocumentState (JSVGCanvas.ALWAYS_DYNAMIC); svgCanvas.setSVGDocument(svgdoc); } });
Thanks in advance Chandra --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]