I'm just trying to use JCanvas3D instead of Canvas3D in an existing project.
This project contains a class which subclasses Behavior and uses
WakeUpOnAWTEvent to react on clicks on points (picking, etc.). The problem was
that processStimulus() of the Behavior subclass was never called.
The reason for that is the way events are handled internally by Swing. JCanvas3D
passes MouseEvents to the offscreen Canvas3D in its processMouseEvent() method.
But as long as no MouseListener is registered with the Component or
enableEvents() is called with the event mask of the event, this method is not
I think this could also be the reason for this bug. Calling enableEvents() with
the appropriate event masks just after the offscreen Canvas3D was initialized
should fix it. Another nice effect would be that OrbitBehavior probably would
work again. I'm using a modified version of it in my project and call
enableEvents() on the JCanvas3D for the events:
After that I can rotate and translate the view.