List Info

Thread: no able to display svg image




no able to display svg image
user name
2006-08-06 01:00:23
hi

i try to display a svg image on a panel

imgPane.setImgFile(new 
File("/home/test/workspace/Jono/picture/education/cray
on.svg"));
imgPane.displayImg();


public void setImgFile(File imgFile) {
  this.imgFile = imgFile;
}

public void displayImg(){
  svgCanvas.setURI(getImgFile().toString());


i get this error



java.io.IOException: Unable to make sense of URL for
connection
	at
org.apache.batik.util.ParsedURLData.openStreamInternal(Unkno
wn Source)
	at org.apache.batik.util.ParsedURLData.openStream(Unknown
Source)
	at org.apache.batik.util.ParsedURL.openStream(Unknown
Source)
	at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocumen
t(Unknown 
Source)
	at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocu
ment(Unknown 
Source)
	at
org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown
Source)
	at org.apache.batik.swing.svg.SVGDocumentLoader.run(Unknown
Source)


any idea?


thanks

------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org

no able to display svg image
user name
2006-08-09 12:55:34
Hi Marc,

Marc Collin <collinmlaboiteaprog.com> wrote on 08/05/2006
09:00:23 PM:

> public void setImgFile(File imgFile) {
>   this.imgFile = imgFile;
> }
> 
> public void displayImg(){
>   svgCanvas.setURI(getImgFile().toString());

   The Canvas wants a URI/URL not a local file system
reference
so you should use the 'FILE.toURL().toString()'

> java.io.IOException: Unable to make sense of URL for
connection


------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )