Hi!!!

I have six to seven JSVGCanvases loaded into a single
applet. It works fine in one system, but when i load i
into another, it doesnt work. Most of the time the
canvas is not show in the appletviewer, and in the
browser, sometimes, the cavas is loaded with the image
and sometimes, when i refresh the page, it is not
loaded.

It is really inconsistent in that way. Is there any
problem with the way I am loading the SVGDocument? 
The piece of code using which i load the SVGCanvas is 

<code>
[snip] 

JPanel svgPanel = new JPanel( new BorderLayout() );

        if (Pref.USE_SVGPANES) {
            JSVGCanvas jsvgcanvas = new JSVGCanvas();
             
            // parse String into DOM Document
            StringReader reader = new StringReader(
SVGImage );
            String parser =
XMLResourceDescriptor.getXMLParserClassName();
            SAXSVGDocumentFactory f = new
SAXSVGDocumentFactory( parser );

            // http://foobar/sample.svg - It is just a
fake uri
            // this is specially important if the doc
reference other doc
            // in relative URI
            try {
                doc = f.createSVGDocument(
"http://foobar/sample.svg",reader );
            } catch( Exception e ) {
                // do nothing
                System.err.println( "ERROR: Error
creating document element" );
            }

           
            // make the document dyanamic for future
loading of data into it.
            jsvgcanvas.setDocumentState(
JSVGCanvas.ALWAYS_DYNAMIC );

            // turn off the zoom in and rotator
effects
            jsvgcanvas.setEnableRotateInteractor(
false );
            jsvgcanvas.setEnableImageZoomInteractor(
false );
            jsvgcanvas.setEnableZoomInteractor( false
);
            jsvgcanvas.setEnablePanInteractor( false
);

            // set the doc to canvas
            jsvgcanvas.setSVGDocument( doc );
            jsvgcanvas.setBackground( Color.blue );
            svgPanel.add( jsvgcanvas );

        } else  {   // not Pref.USE_SVGPANES

            svgPanel.setBackground( Color.white );
            svgPanel.add( new JLabel( SVGImage ) );
            svgPanel.setMaximumSize( new Dimension(
400,100 ) );
            svgPanel.setMinimumSize( new Dimension(
400,40 ) );
            svgPanel.setPreferredSize( new Dimension(
400,50 ) );
        }
[snip]

</code>

Please help!!

Regards,
R K




=====
You are the one, the only one!!!


                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to