I want to create a Swing user interface component (a java bean) which displays a 3D view of a model. The natural way to do it would be to extend the GLCanvas class of JOGL and add the extra functionality that I need, but unfortunately that possibility is precluded by the JOGL design decision to create GLCanvas instances only through an object factory (GLDrawableFactory), which also complicates its use in GUI editors.
The only other option that I see is to have my component contain an instance of a GLDrawable which the component manages behind the scenes, and to somehow copy the image created on the GLDrawable to my component each time I’m asked to paint. This seems needlessly inefficient, however, and I’m not sure if the GLDrawable will render anything at all if it’s not actively and visibly used in the GUI. There also seem to be some threading issues due to the different painting methods of JOGL and AWT/Swing.
I’d be very grateful if anyone could give me some help on how I might go about creating such a component, given these constraints!