2

I've got an old Swing desktop application that I want to convert into an applet, and replace all the file IO with web service calls. I'm struggling to find a comprehensive list of specific things that applets are and are not allowed to do.

I understand that local file IO is not allowed with a signed certificate, and I believe that the applet plugin checks to see what API calls are made in the compiled code in order to work out whether your applet is allowed to run. What exact classes and methods are disallowed in the applet sandbox?

Additionally, are there any common approaches to this sort of conversion?

DeejUK
  • 12,891
  • 19
  • 89
  • 169
  • 1
    Reconsider the entire applet idea. If you already have a `JFrame` based desktop app., launch it from a link using [Java Web Start](http://stackoverflow.com/tags/java-web-start/info). As to files for app. resources, generally unworkable for applets **or** apps. launched using JWS. Are the files for read only, or read/write? What are the files (what is in them, how big are they..)? Both applets and JWS apps. are subject to a security sand-box, it is possible to relax the sand-box for code that is digitally signed, and that requests `j2ee-application-client-permissions` or `all-permissions`. – Andrew Thompson Aug 07 '12 at 09:22
  • Local file io is allowed if the applet is signed. Are you prepared to sign it? In general , just run your app as an applet and test it - simple as that really. If you sign it then you shouldn't have many problems! – davidfrancis Aug 07 '12 at 08:07

1 Answers1

0

applet or java web start without sign cannot access local file, http access to other than where the applet/jws is, microphone stuff. Using JWS without sign, you can even have openfiledialog or savefiledialog to let user decide whether to save a file locally or load.

Here are something you can do: know where your mouse is, mouse click, get key inputs, draw 2D, play sound/mp3/midi, know the screen size, move the JWS window, access any file on the same server, use http get or post to write back to server if you have a server side web app.

Hai Bi
  • 1,173
  • 1
  • 11
  • 21