If you deploy the app. using Java Web Start, an interest in file-types can be declared in the launch file. See the demo. of the file services, which..
..prompts the user to associate file extension .zzz
(simply a file type unlikely to clash with existing file associations) of content type text/sleepytime
. ..
When the user double clicks a .zzz
file, it should open in the app. Actually, the word 'prompts' there is not the whole story. If you launch the sand-boxed version you will be prompted as to associating the file-type. The trusted version does not prompt.
To add more user-control to the process, look to the IntegrationService
that was introduced in 1.6.0_18 (I don't have a demo. of that one yet). You might run it at start-up, after checking with the user.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…