You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by marco <th...@iol.it> on 2002/11/20 21:55:16 UTC

applet

Hi all,

this is my question:


I have tried a simple applet with a JSVGCanvas.
With the appletviewer I haven't had any problems, but with
the browser (Mozilla + plugin jre 131 on windows2k) I got this exception:

java.lang.ExceptionInInitializerError:
 java.security.AccessControlException:
 access denied (java.util.PropertyPermission
org.apache.batik.min_repaint_time read)



Any Ideas? (I can't sign the applet :-( )

Thank you,

Marco.
themommi@iol.it





PS My source code is:


//===================================================
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import java.util.*;
import java.net.*;
import java.io.*;
import org.apache.batik.swing.*;
import org.w3c.dom.svg.*;
import org.w3c.dom.*;
import org.apache.batik.dom.svg.*;




public class Applet1 extends JApplet
{
 public void init()
   {
    JSVGCanvas svgCanvas = new JSVGCanvas();
    DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
    String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
    SVGDocument doc = (SVGDocument)impl.createDocument(svgNS, "svg", null);

  Element svgRoot = doc.getDocumentElement();

      svgRoot.setAttributeNS(null, "width", "600");
      svgRoot.setAttributeNS(null, "height", "400");

      Random R=new Random();
      for(int n=0;n<30;n++)
      {
       Element rectangle = doc.createElementNS(svgNS, "rect");
       rectangle.setAttributeNS(null, "x", ""+R.nextInt(580));
       rectangle.setAttributeNS(null, "y", ""+R.nextInt(380));
       rectangle.setAttributeNS(null, "width", "50");
       rectangle.setAttributeNS(null, "height", "25");

   int colore=R.nextInt(4);
   if(colore==1) rectangle.setAttributeNS(null, "style", "fill:red");
   else if(colore==2) rectangle.setAttributeNS(null, "style", "fill:green");
   else if(colore==3) rectangle.setAttributeNS(null, "style",
"fill:yellow");
   svgRoot.appendChild(rectangle);
  }
  svgCanvas.setSVGDocument(doc);
  getContentPane().add(svgCanvas);
 }
}
//================================================




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


RE: applet

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "marco" == marco  <th...@iol.it> writes:

marco> I have tried a simple applet with a JSVGCanvas.  With the
marco> appletviewer I haven't had any problems, but with the browser
marco> (Mozilla + plugin jre 131 on windows2k) I got this exception:

marco> java.lang.ExceptionInInitializerError:
marco> java.security.AccessControlException: access denied
marco> (java.util.PropertyPermission org.apache.batik.min_repaint_time
marco> read)

marco> Any Ideas? (I can't sign the applet :-( )

Hi Marco,

   Try using current CVS, this bug should be fixed there.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org