Run normal Jar file in web page with the help of applet

13,929

Launch the frame based app. from a link using Java Web Start.


No it is not frame based, it is actually printer application via serial port connection, so right now im trying to rewrite in applet from scratch

To get it to work on the client-side (easily for the client) will require either an embedded (or free-floating) applet or a free floating frame launched using JWS. Take your pick. Note that unless the code is digitally signed (by you) and trusted (by the end user) it will not be able to print.

There is a service available to allow sand-boxed apps. deployed using JWS to print, but it would not be as specific as accessing the serial port, and would require changes to the code.


I got a bit confused when you mentioned 'convert' and thought you meant that it was based in a free floating frame. Now you explain it is neither an applet or frame makes something more clear for me.

..should I rewrite all my java code as applet?

No, of course not. You just add that Jar to the run-time class-path of the applet using the archive attribute, then call it from the init() or start() (as appropriate) methods of a very simple applet.

But I still recommend using JWS for a free floating frame over using an applet. The code for either is easy, but applet deployment is a lot harder.

Share:
13,929
Ujju
Author by

Ujju

Proud Programmer and a gamer

Updated on June 05, 2022

Comments

  • Ujju
    Ujju almost 2 years

    I have a Jar file created in Java which contains external libraries along with class files (to make it more complicated). Our mission is to somehow run this program on web.

    Applets are used to run Java on HTML but my problem is my jar is not Applet Jar so I can't include jar in applet tag, so should I rewrite all my java code as applet or is there any simple way as to just convert my jar to applet jar and include on HTML?

  • brimborium
    brimborium almost 12 years
    That is actually his question... (Applets are used to run java on html but my problem is my jar is not Applet Jar so i cant include jar in applet tag)
  • Ujju
    Ujju almost 12 years
    No it is not frame based, it is actually printer application via serial port connection, so right now im trying to rewrite in applet from scratch :(
  • Ujju
    Ujju almost 12 years
    tnks,Yes deploying Applet is more harder than running applet(or might be im still noob in applets :P),,so now i used frames and trying to launch via JWS to web support,.or just give as an application for client