Login  Register

Why would a GLJPanel not display in the NetBeans form's JFrame?

Posted by WoodManEXP on Jan 22, 2022; 6:51pm
URL: https://forum.jogamp.org/Announcing-Simple3D-tp4041486p4041601.html

My attempts to get the GLJPanel  created by Simple3D to display in a swing JFrame (as created by a NetBeans form) are not working. The Simple3D constructor was modified to accept a JFrame object as a parameter, rather than creating its own JFrame.

The Simple3D constructor creates the GLJPanel then calls initFrame()

    GLJPanel canvasPanel = initCanvas();   // a JOGL Panel
    initShaderUniv();
    initFrame(frameToUse, title, canvasPanel);

initFrame then adds the GLJPanel to JFrame referenced by frameToUse rather than creating its own JFrame.

But the graphic does not display. In the same NetBeans app if initFrame() creates the JFrame then that frame displays with the graphic (the rotating Earth example).

Does anyone have any thoughts as to why the GLJPanel would not be displaying in the NetBeans form's JFrame?

TY,