本文介绍了在Windows中将自定义文件扩展名与java应用程序相关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Windows下将几个文件扩展名链接到我的java应用程序中。当用户双击带有链接扩展名的文件时,我想打开我的应用程序,我需要知道启动应用程序的文件路径。

I would like to "link" few file extensions to my java application under windows. When user double clicks file with "linked" extension, I would like to open my app and I need to know path to file that launched app.

推荐答案

如果部署应用程序。使用,可以在启动文件中声明对文件类型的兴趣。请参阅,...

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..

当用户双击 .zzz 文件时,它应该是在应用程序中打开。实际上,提示这个词并不是整个故事。如果启动沙盒版本,系统将提示您关联文件类型。受信任的版本不会提示。

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.

要向流程添加更多用户控制,请查看在1.6.0_18(我还没有那个演示。)在与用户核实后,您可以在启动时运行它。

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.

这篇关于在Windows中将自定义文件扩展名与java应用程序相关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 04:12