是否可以将Java应用程序设置为默认文件打开器? [英] Have the ability to set Java application as default file opener?

查看:86
本文介绍了是否可以将Java应用程序设置为默认文件打开器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一种方法,让用户将我的程序设置为默认程序,以打开文件一段时间,却一无所获。我有一个应该在Mac,Windows和Linux上通用的程序,所以我不想使用仅适用于一个OS的方法。那么,如何使用户能够将Java应用设置为默认文件打开器?我会使用桌面类吗?

I've been searching for a way to have users set my program as the default to open files for awhile and found nothing. I have a program that is supposed to be universal for Mac, Windows and Linux, so I don't want to use a method that only works with one OS. So how can I give users the ability to set a Java app as the default file opener? Would I use the Desktop class?

推荐答案

没有Java不支持该类。您将需要为每个要使用其本机语言(c ++,目标c等)支持的OS编写一个小型应用程序,该应用程序只要在打开时就启动Java应用程序即可。然后,您可以将该应用设置为默认程序。

No Java does not support this. You would have to write a small app for every OS that you want to support in its native language (c++, objective c, etc.) that would simply launch your java app whenever it is opened. You can then set that app as the default program.

这篇关于是否可以将Java应用程序设置为默认文件打开器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆