aspose file tools*
The moose likes Applets and the fly likes Running Applet from DLL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Running Applet from DLL" Watch "Running Applet from DLL" New topic
Author

Running Applet from DLL

Prash Singh
Ranch Hand

Joined: Aug 23, 2009
Posts: 103

Dear All,

I am having a requirement which I don't know can be solved or not.
Really looking forward for some suggestion.

I created an Applet which works fine when all the code and resources are packaged in to the jar and provided in the archive tag of the applet tag.
The thing is , now the jars are replaced with .dll files with all the jars .
Now when I am running the applet, is show ClassNotFoundException for the code attribute which has the main class of the jar ( which invokes the applet).

I want to ask , that is it possible the way it has been requested?
Also, are there some code changes required to be done in the applet's init() to locate or call those dll files.


Thanks in advance.


Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
What do you mean by "with .dll files with all the jars"? Class files are distributed in jars (or as a hierarchy of loose files), not as DLLs. The only way to use DLLs is via JNI, which would still need a proper Java class to get started, at the least the one that's mentioned in the <APPLET> tag.
Prash Singh
Ranch Hand

Joined: Aug 23, 2009
Posts: 103

Dear Tim,
We originally had a swing application , which was required to deployed on web.
So for that purpose Applet was created which works successfully with all the jars required.
We used to distribute our application in .exe format and with the .dll files which were created using a tool JET Compiler
which compiles, packages the jars into .dll files.
The approach worked fine for Swing application .
So same approach is required in Applet too.



Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
First off, why didn't you make it a JavaWebStart application? Those can be distributed via the web, but otherwise are pretty much the same as regular desktop applications. It seems that would have been a much better fit if you already had a working desktop app.

If you want this to be an applet, then it needs to be an applet - that means no exe to start it, but rather a regular Java class that extends Applet or JApplet.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running Applet from DLL