Hi all!
I'm new to this NG so I will try to explain my problem.
I'm using JAVA3D
int o a JApplet. This is the code
[CODE]
import JAVA.util.*;
import JAVA.net.*;
import JAVA.awt.*;
import JAVAx.swing.*;
import com.sun.j3d.utils.
applet .MainFrame;
import com.sun.j3d.utils.universe.*;
import JAVAx.media.j3d.*;
import JAVAx.vecmath.*;
...
public
class OSESKeyNav extends JApplet
{
private static final int WINDOW_WIDTH = 800;
private static final int WINDOW_HEIGHT = 700;
private static
URL url = null;
private int simulationStage = 0; // 0->init, 1->prima visualizzazione
private Receiver receiver;
private Sender sender;
private ObjectsUpdater updater;
private HashMap objList;
private UniverseManager universe;
private Camera camera;
public OSESKeyNav() { }
public OSESKeyNav( String
host )
{
receiver = new Receiver( host );
objList = new HashMap();
setLayout(new BorderLayout());
GraphicsConfiguration config =
SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas3D = new Canvas3D( config );
canvas3D.setSize( WINDOW_WIDTH, WINDOW_HEIGHT );
add("North", canvas3D);
universe = new UniverseManager();
createSceneGraph();
updater = new ObjectsUpdater( objList, receiver );
updater.start();
addCamera( canvas3D );
universe.makeLive();
}
private void createSceneGraph()
{
...
}
private void addCamera( Canvas3D canvas )
{
....
}
public void init()
{
url = getCodeBase();
String host = url.getHost();
OSESKeyNav applet = new OSESKeyNav( host );
new MainFrame(applet, WINDOW_WIDTH, WINDOW_HEIGHT);
}
}
[/CODE]
When I try to view this applet with my
browser JVM returns this exception
JAVA.security.
Access ControlException: access denied
(JAVA.util.PropertyPermission * read,write)
at JAVA.security.AccessControlContext.checkPermission(Unknown Source)
at JAVA.security.AccessController.checkPermission(Unknown Source)
at JAVA.lang.SecurityManager.checkPermission(Unknown Source)
at JAVA.lang.SecurityManager.checkPropertiesAccess(Unknown Source)
at JAVA.lang.System.getProperties(Unknown Source)
at com.sun.j3d.utils.applet.MainFrame.build(Unknown Source)
at com.sun.j3d.utils.applet.MainFrame.
<init>(Unknown Source)
at OSESKeyNav.init(OSESKeyNav.JAVA:186)//-------------------------new
MainFrame(applet, WINDOW_WIDTH, WINDOW_HEIGHT);
at sun.applet.AppletPanel.run(Unknown Source)
at JAVA.lang.Thread.run(Unknown Source)
I do not know where is the problem.
I tried to use a JPanel instead of MainFrame: the errors disappears but I
do not see the canvas3d.
Please help me!:)
Thanks to all!
(sorry for my bad english)