Problem with NetBeans and Jogl!

Hi mates, i have install the netbeans 6.7 and this plugin for the jogl http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=3260! I try to compile the this program:


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.media.opengl.*;

public class SimpleJoglApp extends JFrame{

    public static void main(String[] args) {
        final SimpleJoglApp app = new SimpleJoglApp();

        // show what we've done
        SwingUtilities.invokeLater (
            new Runnable() {
                public void run() {
                    app.setVisible(true);
                }
            }
        );
   }

    public SimpleJoglApp() {
        //set the JFrame title
        super("Simple JOGL Application");

        //kill the process when the JFrame is closed
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //only three JOGL lines of code ... and here they are
        GLCapabilities glcaps = new GLCapabilities();
        GLCanvas glcanvas = GLDrawableFactory.getFactory().createGLCanvas(glcaps);
        glcanvas.addGLEventListener(new SimpleGLEventListener());

        //add the GLCanvas just like we would any Component
        getContentPane().add(glcanvas, BorderLayout.CENTER);
        setSize(500, 300);

        //center the JFrame on the screen
        centerWindow(this);
  }//end constructor SimpleJoglApp()

    public void centerWindow(Component frame) {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize  = frame.getSize();

        if (frameSize.width  > screenSize.width ) frameSize.width  = screenSize.width;
        if (frameSize.height > screenSize.height) frameSize.height = screenSize.height;

        frame.setLocation (
            (screenSize.width  - frameSize.width ) >> 1,
            (screenSize.height - frameSize.height) >> 1
        );
    }//end method centerWindow

}//end class SimpleJoglApp

and i take two errors, the first is createGLCanvas and the error it says “cannot find symbol” and the second error is SimpleGLEventListener and it says “cannot find the symbol”! The code i take from this sitehttp://www.genedavissoftware.com/books/jogl/ljogl_ch1.html Help me, please!

Thanks for your attention!

Simplest way would be to generate the project from a provided JOGL template and modify it afterwards.

If you don’t want that, use the steps described in this post: http://www.java-gaming.org/index.php/topic,18980.msg149535.html#msg149535

Those demos are a little old and jogl1 no longer uses createGLCanvas(). Instead replace that line with GLCanvas = new GLCanvas(), and you should be okay.

The SimpleGLEventListener is probably another file that came with the demo that you should download. Jogl doesn’t come with any SimpleGLEventListener class. It does have a GLEventListener interface, which is pretty simple so you might just want to make your own.

Thanks for the help mates, where i can find a tutorial for beginners?