• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Executable Jar file: Not working after being embedded within a html page?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I have a small problem with my applet when embedding within a html page.

The applet works fine when ran as a Jar Executable, yet when embedded into html (Even after being signed) it throws this error...



The applet itself downloads files from an address to be loaded later from another program, without having to re-download everytime someone decides to use the other program. As stated before, running as an executable jar works perfectly fine. The applet is signed, and here is the source of a test html page to display the applet:



I don't believe there are any errors, the code will execute perfectly via executable jar or from the classes using a batch file.

Thanks for your time,
~Kieran
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The applet works fine when ran as a Jar Executable, yet when embedded into html (Even after being signed) it throws this error...


An executable jar file depends on there being a class having a main method. An applet works rather differently - it needs to extend the Applet (or JApplet) class - does your FileDownloader class do that?
 
Kieran Shoo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:

The applet works fine when ran as a Jar Executable, yet when embedded into html (Even after being signed) it throws this error...


An executable jar file depends on there being a class having a main method. An applet works rather differently - it needs to extend the Applet (or JApplet) class - does your FileDownloader class do that?



I've fixed this now - thanks alot
 
Sheriff
Posts: 28411
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not exactly a problem that your class has a main method. But when the browser goes to run your applet, it isn't going to call that main method. It wants to call some other methods, and that's where the problem arises. You should have a look at the Applet Tutorial to see what you should be doing instead.
 
Kieran Shoo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh so instead of the main method I should be using the initialize method.

Thanks alot, i'll test to see if it works just now.
~Kieran

-Edit-

Alright, I replaced



With



However it still throws an error upon running the applet...

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic