• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

How can I launch my local windows application from an applet?

Hello all,

Most of the applications I work on are browser-based, with the exception of one.
I'd like to create an applet that would allow me to launch the local windows application from the web page, just like my other apps.

I've heard this is possible, but I believe this would involve digitially signing my applet, something I unfortunately know little about.
I would appreciate any and all suggestions on how I can learn to create a digitally-signed applet for launching apps...tutorials, samples, books, anything you've got.

Thanks!

 
0
Inward_Spiral
Asked:
Inward_Spiral
  • 4
  • 2
  • 2
  • +2
5 Solutions
 
aozarovCommented:
After you signed your applet using the links above you can launch your windows program from Java like this:
Runtime.getRuntime.exec(....) -> http://javaalmanac.com/egs/java.lang/Exec.html
e.g.
Runtime.getRuntime().exec("cmd /c start /b notepad");or
or
Runtime.getRuntime().exec("rundll32 url.dll FileProtocolHandler http://www.google.com/");
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
objectsCommented:
You can also avoid signing by granting the required permissions in your policy file

http://java.sun.com/docs/books/tutorial/security1.2/tour1/step2.html
0
 
objectsCommented:
The policy file changes only applies to running  applets on the machine you make the changes on, so if you are only doing this on a few machines it may be suitable.
0
 
shivamohanCommented:
One neat little alternative would be to launch your application using java web start. Here is what you do:
1) Package your application into a single jar with the manifest file pointing to your desired main class
2) Sign your new jar
3) Make a JNLP file from your jar file. Have your web server provide that jnlp file to your visitors
4) Tell your server that JNLP's are a special MIME type

Viola...now you should be able to serve applications as if they were applets!

Hope this helps. :-)
0
 
Inward_SpiralAuthor Commented:
Wow...thanks, you all have definitely given me plenty of reading material.

Regarding Java Web Start...I've never really worked with that, what is the advantage of using that over "traditional" applets?
0
 
aozarovCommented:
>> what is the advantage of using that over "traditional" applets?
see: http://java.sun.com/j2se/1.5.0/docs/guide/javaws/index.html
and
http://java.sun.com/products/javawebstart/developers.html
You can run it outside the browser. it can link to a site to accept updates and it has an API to get some services (print/File) even without signing (see: http://java.sun.com/j2se/1.5.0/docs/guide/javaws/jnlp/index.html)
0
 
objectsCommented:
> what is the advantage of using that over "traditional" applets?

mainly just removing the hassles associated with running inside a browser.
0
 
Inward_SpiralAuthor Commented:
Thanks, everybody. I've still got a lot to learn, but I've got a test environment running on my system, and my applets can access the local filesystem. One step at a time...
0
 
CEHJCommented:
:-)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 4
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now