The method you want is setURI( String url ) on the JSVGCanvas object. If you have a JSVGCanvas object named can, you can do the following:
can.setURI( "http://www.example.com/really_cool.svg" ); to retrieve the svg file listed. There may be some difficulty with where you can retrieve the files in an applet. (I've just been testing locally at present.) If I've missed some details, someone will probably correct me.<grin/> G. Wade Claire WALL wrote: > so how do we import/use an svg file for use on an applet? the only > way i've seen to do it is via writing the code line by line to draw the > desired svg graphic onto an applet/application (the examples that > are on the batik site). > > if anybody has some sample code that would show me how to do > this then that would be really helpful as there is nothing at the > Apache site. > > - claire :) > > On 10 Feb 2003, at 9:58, G. Wade Johnson wrote: > > > The answer to your second question is the answer to your first. > > > > Yes, you can load SVG files in Batik. That's actually it's purpose. > > Given that, the advantage to using Batik is loading graphics from > > SVG files instead of drawing them in Java. > > > > G. Wade > > > > Claire WALL wrote: > > > > > hi, > > > > > > just have a couple of questions/queries about batik that i need > > > answering. > > > > > > 1) What is the difference between using standard java graphics in > > > an applet and SVG graphics using batik? I know the differences > > > between SVG graphics and Java graphics but with regards to the > > > implementation and how you write the code to create the graphics, > > > there doesnt appear to be any advantage of using SVG over Java > > > graphics because they are written by the user in pretty much the > > > same way. The reason I'm asking is because i was going to use > > > SVG graphics in an applet for a project i'm doing but i don't see the > > > advantage of using these over normal java graphics. > > > > > > 2) Is there any way to use proper SVG code/files with Java applets > > > rather than having to write proper java code and do the graphics line > > > by line? It would be so much easier to just have an SVG file and > > > like import it someway rather than having to create it line by line in > > > the java code. > > > > > > if anybody could answer my questions, that would be great. > > > > > > thanks :) > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
