I’d like to build a Java3D application using the Eclipse 3.0 RCP (Rich Client Platform) and am having problems embedding Java3D code into SWT.
In my display (which extends org.eclipse.ui.part.ViewPart) I have the method which creates a view, inside of which I use the SWT/AWT bridge to create the frame which can (hopefully) eventually embed a Canvas3D. The relevant code looks like this:
public void createPartControl(Composite parent) {
// parent is not of style SWT.EMBEDDED
// so need to create my own container for awt
// components
containerJ3D=new Composit(parent,SWT.EMBEDDED);
Frame frame = SWT_AWT.new_Frame(containerJ3D);
// this works just fine
frame.add( new java.awt.Label(“AWT Label”) );
GraphicsConfigTemplate3D template;
// this line causes a runtime error message:
// “An error has occurred when creating this view”
template = newGraphicsConfigTemplate3D();
}
I suspect that since Java3D and SWT both use native resources that there’s some native graphics resource conflict that I don’t know about.
Does anybody have any ideas about this?
Thanks!