Following tutorial AWT Frame does not display

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

Following tutorial AWT Frame does not display

kralvarado
I'm new to JOGL. I'm using winXP-32bit, on an AMD64 bit (Acer Aspire 5004). I followed the directions to install JOGL into Eclipse by creating the User Libraries and pointing to the gluegen-rt.jar jogl.all.jar and pointed the native library to the jogamp-windows-i586\lib directory.

I used the following exampe code, found on a website, to test if I had installed correctly.

public class SimpleScene {
public static void main(String[] args) {
GLProfile glp = GLProfile.getDefault();
GLCapabilities caps = new GLCapabilities(glp);
GLCanvas canvas = new GLCanvas(caps);

Frame frame = new Frame("AWT Window Test");
frame.setSize(300, 300);
frame.add(canvas);
frame.setVisible(true);

frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
}

When running, nothing happened, no window would display. However, when I changed canvas from GLCanvas and used a java.awt.Canvas instead the frame would display. When debugging, I noticed that the debugger would hang on the line frame.setVisible(true);

I'm at a loss, because I followed the same steps on an Eee PC netbook, the same configuration and code displayed the frame window as expected.

Any help would be greatly appreciated. Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Following tutorial AWT Frame does not display

gouessej
Administrator
Hi

Rather use my simple example, you can find it on Wikipedia:
http://en.wikipedia.org/wiki/Java_OpenGL
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Following tutorial AWT Frame does not display

kralvarado
Ok, I used the example you mentioned http://en.wikipedia.org/wiki/Java_OpenGL.  Again I'm having the same issue:

The java.awt.Frame does not display when using GLCanvas.  If I create a java.awt.Canvas the Frame displays.  I think the issue is with JOGL and my machine.

Has anyone had a similar issue and found a resolution?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Following tutorial AWT Frame does not display

Sven Gothel
Administrator
In reply to this post by kralvarado
On Sunday, January 22, 2012 11:18:08 AM kralvarado [via jogamp] wrote:

>
> I'm new to JOGL.  I'm using winXP-32bit, on an AMD64 bit (Acer Aspire 5004).
> I followed the directions to install JOGL into Eclipse by creating the User
> Libraries and pointing to the *gluegen-rt.jar* *jogl.all.jar* and pointed
> the native library to the *jogamp-windows-i586\lib* directory.
>
>
> I used the following exampe code, found on a website, to test if I had
> installed correctly.
>
>
> public class SimpleScene {
>
>     public static void main(String[] args) {
>
>         GLProfile glp = GLProfile.getDefault();
>
>         GLCapabilities caps = new GLCapabilities(glp);
>
>         GLCanvas canvas = new GLCanvas(caps);
>
>
>         Frame frame = new Frame("AWT Window Test");
>
>         frame.setSize(300, 300);
>
>         frame.add(canvas);
>
>         frame.setVisible(true);
>
>
>         frame.addWindowListener(new WindowAdapter() {
>
>             public void windowClosing(WindowEvent e) {
>
>                 System.exit(0);
>
>             }
>
>         });
>
>     }
>
> }
>
>
> When running, nothing happened, no window would display.  However, when I
> changed *canvas *from *GLCanvas *and used a *java.awt.Canvas* instead the
> frame would display.
>
> When debugging, I noticed that the debugger would hang on the line
> *frame.setVisible(true);*
>
>
> I'm at a loss, because I followed the same steps on an Eee PC netbook, the
> same configuration and code displayed the frame window as expected.
>
>
> Any help would be greatly appreciated.  Thanks in advance.

Probably a bug either in JOGL or WinXP/OpenGL-Driver, sure.

Please send more information, follow the bug report instruction please:
  http://forum.jogamp.org/Problem-with-GLProfile-and-jogl2-rc2-td3447491.html#a3447546

.. the mentioned debug information should be helpful (test_dbg.log).

Pls use latest JOGL:
  http://forum.jogamp.org/New-pre-release-Unsigned-gluegen-480-joal-273-jogl-633-jocl-538-td3683267.html

~Sven
Reply | Threaded
Open this post in threaded view
|

Re: Following tutorial AWT Frame does not display

gouessej
Administrator
In reply to this post by kralvarado
Hi

At first, use the latest version of JOGL as Sven suggested.

Then, put jogl.all.jar and gluegen-rt.jar into your classpath (right-click on your project -> "Properties" -> "Java Build Path" -> "Libraries" -> "Add External JARs"). Put the JAR(s) containing the native libraries into the same directory than jogl.all.jar.

After that, try again running your project. If it does not solve your problem, try some online demos using JOGL 2.0, maybe give a try to mine. This test will allow us to determine whether it is a problem of setup in your environment or a JOGL 2.0 bug. Please follow Sven's instructions, enable the logs so that we get some more information about the cause of this freeze. Best regards.

Edit.: I agree with Sven's suggestion, it is unfortunately common to have some problems when using 32 bits OpenGL driver on a 64 bits architecture under Microsoft Windows.
Julien Gouesse | Personal blog | Website