Hello, i have a little problem with det gui thread getting blocked.
I have an example of what i mean:
public class Block extends JFrame implements GLEventListener
{
private GLCanvas canvas = null;
private JPanel panel;
public Block()
{
panel = new JPanel();
panel.add(new JButton(“test”));
add(panel,BorderLayout.EAST);
canvas = new GLCanvas();
canvas.addGLEventListener(this);
add(canvas);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(300,300);
setVisible(true);
}
public void display(GLAutoDrawable glDrawable)
{
while(true);
}
public void displayChanged(GLAutoDrawable glDrawable, boolean modeChanged, boolean deviceChanged)
{}
public void init(GLAutoDrawable glDrawable)
{
}
public void reshape(GLAutoDrawable glDrawable, int x, int y , int width , int height)
{}
public static void main(String args[])
{
Block b = new Block();
}
}
When i run this example, it is not possible to push the button, i just wondered if it’s possible to use gui components even if
gl is running at the same time.