Deadlock on SimpleUniverse.getPreferredConfiguration() from Swing

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Deadlock on SimpleUniverse.getPreferredConfiguration() from Swing

Sebastian Lewalder
Hi everybody,

I am using j3dcore-pre5.jar and j3dutils.jar (1.6.0-pre2) from the github and Jogl 2.0 rc11 is retrieved via maven central repository. Java version is 1.6.

I have problems creating a 3D scene as a result of clicking a button in swing.
So i stripped the code until the following was left over.

import java.awt.Dimension;
import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JFrame;

import com.sun.j3d.utils.universe.SimpleUniverse;

public class TestDeadlock
{
        public static void main(String[] args)
        {
                JFrame frame = new JFrame();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setSize(new Dimension(800, 600));
                frame.add(new JButton(new AbstractAction()
                {
                        {
                                putValue(Action.NAME, "Deadlock");
                        }
                       
                        @Override
                        public void actionPerformed(ActionEvent e)
                        {
                                SimpleUniverse.getPreferredConfiguration().getDevice();
                        }
                }));
                frame.setVisible(true);
        }
}

This still produces a deadlock for me.
Is there a workaround for this problem or is there someting wrong with my code?

Thanks in advance for your support.

Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: Deadlock on SimpleUniverse.getPreferredConfiguration() from Swing

hharrison
Please try with the -pre7 builds available here:

http://jogamp.org/deployment/java3d/1.6.0-pre7/

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: Deadlock on SimpleUniverse.getPreferredConfiguration() from Swing

Sebastian Lewalder
Thanks for the hint, the problem seems to be fixed.

Sebastian