Stupid Newbie-Question

Hello!

I am new with OpenGL and JOGL.
In every Tutorial I read, is a “GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas( new GLCapabilities() );”
But my Eclipse says, that there is no “createGLCanvas”-Method in Class “GLDrawableFactory”.
Have I done a Mistake, or has just the API changed? What was the right Line of Code than?

You are working with an old tutorial and a new version of jogl.
Just create you Canvas with new Canvas() (you can also specify a Capabilities object if you want…)

THX, it seems like it works!
But the Result is a little strange:


http://img404.imageshack.us/img404/1306/helloworldii5.th.gif

The Code:

package test;

import java.awt.Color;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.media.opengl.GLCanvas;


public class TestMain {
	public static void main(String[] args) {
	       Frame frame = new Frame("Hello World!");

	        GLCanvas canvas = new GLCanvas();
	        frame.add(canvas);

	        frame.setSize(300, 300);
	        frame.setBackground(Color.white);

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

	        frame.setVisible(true);
	}
}

It’s quite normal since you d’ont draw anything into your GLCanvas, you only get garbage from your video memory… a kind of abstract art maybe?
You should have a look at the jogl-demos, Gears for example, to get started with the framework.