Java3D and SWT/RCP

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!

hi,

i was doing exactly similar thing just yesterday. i found the same error and looking this forum for a solve. but today, i have solved the problem. surprisingly, the rcp does not find the java3d classes even it is installed in the jre/jdk. all u need is just open the runtime configuration of the rcp and add the j3d classes in the runtime libraries. that’s all :).

unfortunately, java3d flickers annonyingly in swt ??? .

Mahbub Shahriar