export a JOGL applet and embedd into a html page

Posted by nkint on Stack Overflow See other posts from Stack Overflow or by nkint
Published on 2011-01-12T23:19:37Z Indexed on 2011/01/13 3:54 UTC
Read the original article Hit count: 227

Filed under:
|
|
|
|

hi guys it is some time that i'm testing opengl with java and JOGL. now i have good result and i wanto to pubblish it on web. but i have some problem. i'm in eclipse, and i'm testing an Applet with JOGL. first of all i have this run time error (but the program works correctly):

java.lang.IllegalArgumentException: adding a window to a container at java.awt.Container.checkNotAWindow(Container.java:431) at java.awt.Container.addImpl(Container.java:1039) at java.awt.Container.add(Container.java:365) at AppletHelloWorld.init(AppletHelloWorld.java:30) at sun.applet.AppletPanel.run(AppletPanel.java:424) at java.lang.Thread.run(Thread.java:619)

then i found this incredibly clear page and i do what is said, i open html with the browser, the libs are downloaded but it stops at "Starting applet AppletHelloWorld" that is the name i gave to my applet.

mayebe i miss something like main function or exporting well the jar?

this is my main code:

public class AppletHelloWorld extends Applet 
{
public static void main(String[] args)
{
JFrame fr=new JFrame(); 
fr.setBounds(0,0,1015,600);
fr.add(new AppletHelloWorld());

fr.setVisible(true);
}
    public void init() 
{ 
    setLayout(null); 
    MyJOGLProject canvas = new MyJOGLProject(); //MyJOGLProject extends JFrame
    canvas.run();
    Container c = new Container();
    c.add(canvas);
    add(c);
} //....

© Stack Overflow or respective owner

Related posts about java

Related posts about jar