1

Some time ago all major browsers on windows seem to have stopped their support for java applets. Now we search for alternatives.

We have some old and unmaintained applets, often inside websites, which we use in our workflow at university. They are often written by someone else, so we have trouble rewriting things ourself.

Firefox ESR can still display Java applets, but I'm unsure how long NPAPI plugins will be supported there...

I read about appletviewer.exe in the java developer kit, which takes the url and opens all applets from there in an extra window. This works great, but there are cases where it fails...

One example is http://nrv.jinr.ru/nrv/webnrv/grazing
On that site, a html-form is submitted via javascript, calling a php script with a POST request, which returns an html-applet code with parameters, which is injected again via javascript:

<APPLET CODE=grazing.WilczynskiPlot.class ARCHIVE=grazingW.jar WIDTH=700 HEIGHT=700>
  <param name='Z1' value='28'>
  <param name='A1' value='58'>
  <param name='Z2' value='82'>
  <param name='A2' value='208'>
  <param name='ECM' value='268.159'>
  <param name='NE_CM' value='74'>
  <param name='NT_CM' value='161'>
  <param name='NE_LAB' value='74'>
  <param name='NT_LAB' value='171'>
  <param name='ID' value='50018'>
</applet>

The first thing, that comes to my mind, is writing an application, that generates a .html file from a POST/GET-Request as shown above and then give applauncher.exe the filepath. However, I'm unsure if filepaths will work and parameters will be taken correctly...

Quesitions:

  • Is there a way I can give these parameters to the applauncher.exe?
  • Can I also somehow send POST/GET requests to applauncher.exe in case there is a socket-like way of data transmission used?
Julian
  • 493
  • 4
  • 22
  • 1
    Part of this problem can be solved by embedding the applet in a `JFrame` & implementing an `AppletStub` as seen in [this answer](http://stackoverflow.com/questions/6129825/embed-a-3rd-party-japplet-in-a-swing-gui-pass-it-parameters/6131260#6131260). A desktop app. is also capable of implementing sockets. – Andrew Thompson Apr 26 '17 at 01:59
  • @AndrewThompson Thanks for the hint! I guess sockets will be not needed in most cases. If the java applet is directly reading post requests, I will probably run into Port-80 problems anyway... I guess a universal java application would open/download the applet and have a parameter-list GUI to send to the java applet. A Problem I still see is the `grazing.WilczynskiPlot.class` class. If I download the applet and run it in applauncher, this class is reported missing. Will this also be the case in the linked example? – Julian Apr 26 '17 at 09:43
  • 1
    Create an `URLClassLoader` for whatever classes are needed.. E.G. as seen in [this answer](http://stackoverflow.com/a/16335435/418556). – Andrew Thompson Apr 26 '17 at 09:48

0 Answers0