If anyone is familiar with Xj3D API… I found this demo code and he is trying to load a x3d xml image from a JFrame, I can compile but can’t run due to need to configure the peripherals - mouse and keyboard not sure how to do this. I get this java.lang.reflect.InvocationTargetException?
This leads to the next error in running: SYSTEMID provided is wrong. Something with a Internal stack traceorg.xml.sax.SAXException; I realise this is a sun developers site but the folks at www.web3d.org dont have very good help forums.
code :
import java.awt.*;
import java.util.HashMap;
import javax.swing.*;
import org.web3d.x3d.sai.*;
import java.io.*;
public class SimpleSAIDemo extends JFrame {
/**
* Constructor for the demo.
*/
public SimpleSAIDemo() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container contentPane = getContentPane();
// Setup browser parameters
HashMap requestedParameters = new HashMap();
// Create an SAI component
X3DComponent x3dComp = BrowserFactory.createX3DComponent(requestedParameters);
// Add the component to the UI
JComponent x3dPanel = (JComponent)x3dComp.getImplementation();
contentPane.add(x3dPanel, BorderLayout.CENTER);
// Get an external browser
ExternalBrowser x3dBrowser = x3dComp.getBrowser();
setSize(600,500);
show();
// Create an X3D scene by loading a file. Blocks till the world is loaded.
X3DScene mainScene = x3dBrowser.createX3DFromURL(new String[] { "Ernaz is da bomb.x3d" });
// Replace the current world with the new one
x3dBrowser.replaceWorld(mainScene);
}
public static void main(String[] args) {
System.out.println("Here");
SimpleSAIDemo demo = new SimpleSAIDemo();
}
}
windows xp
Xj3D version M10
jdk1.5.0_04
jogl1.1.1