aanders5 0 Junior Poster

Hello, so I am trying to get a Netbeans application on the web, specifically in this location here: http://hellojar.elementfx.com/FunGame/index.html

As you can see it loads, but then crashes as it cannot find "main". (my attempt at trying to find the right run location of my Main)

Here is my HTML index code,

<html>
    <head>
        <title>supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <script src="//www.java.com/js/deployJava.js"></script>
    </head>
    <body>
    <script>
    var attributes = {codebase: 'http://hellojar.elementfx.com/FunGame/',
                      code: 'main',
                      archive: 'FunGame.jar',
                      width: '960', 
                      height: '560'};
    var parameters = {java_arguments: '-Xmx256m'}; // customize per your needs
    var version = '1.6'; // JDK version
    deployJava.runApplet(attributes, parameters, version);
</script>
    </body>
</html>

Now, I grabbed this code off an example site (I think one of W3Schools pages), I "think" I have it setup correctly except for the parameter "code". From my understanding this would be the "applet descriptor" of a Netbeans project.
The problem is that I never set one, and so I am unsure of how to make this application run.

Details:

  • The .jar (FunGame.jar) is in the folder as the index.html, both are located at http://hellojar.elementfx.com/FunGame/
  • When I usually run this program, I right click the class "GameGUI" and hit run. I have mutliple classes, GameGUI has the Main
  • When I go to my project properties, and click on Web Start (where you usually specifiy the applet descriptor), I cannot add a path/url. Most examples I see enter something like "org.me.MyApplet" for this, but I never made one so it says "Application descriptor (use project Main class).
  • I also made a Web Application project. I added my FunGame project to this to generate the index file. I use the .jar from FunGame and the index.html from the Web Application. I have gotten it to work before with Netbean's example, HOWEVER they use the <applet> tag and I was told that this should no longer be used. Therefore I found this script code and am trying to work with that now.

So I "think" I just need a way to reach my Main class for this to run, and then to put that within the "code" parameter, but I am not 100% sure.

Any help would be greatly appreciated, I have been searching and searching but am not getting very far with this.

Thank you,
-Austin

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.