Does anyone know how to make it so that when I go to drag a file onto a jar fie it will give the
+Open with ...
option? Can this be done with Java?
It does not directly support dragging a document onto the icon of the Jar (or in this case, the shortcut), but Java Web Start does provide a facility to declare interest in a file type (a file association).
To have it open in the app. double click that document type, or right click and go to 'open with'.
Note that lots of apps. add a file type association for most images, so you'll be fighting it out with them as to which is the default 'double click' behavior. I don't like your chances of maintaining that default, given many paint apps. will check file association defaults and offer to 'grab back' any that are not assigned to itself.
See the JNLP File Services demo. which..
..prompts the user to associate file extension
.zzz
(simply a file type unlikely to clash with existing file associations) of content typetext/sleepytime
. The build file allows the file-type to be set at build time, see thebuild.xml
in the distributable for details.