如何在OSX上将文件类型与(我的)Java应用程序关联? [英] How to associate a file type with a (my) Java application on OSX?

查看:77
本文介绍了如何在OSX上将文件类型与(我的)Java应用程序关联?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够双击textfile.myext并打开我的Java程序并处理该文件.

I want to be able to double click on textfile.myext and have my java program open and handle the file.

我应该如何使我的程序接受设置为在该程序中打开的默认文件?

How should I go about making my program accept files that are set as default to open in said program?

将某些内容设置为默认值之后,将执行哪些步骤以及将传递给程序的什么内容?

What are the steps and what is passed to the program after something is set as default?

推荐答案

部署应用.使用提供的 Java Web Start .

Deploy the app. using Java Web Start, which provides..

.. splash屏幕,桌面集成,文件关联,自动更新(包括延迟下载和更新的程序控制),本机分区和按平台,体系结构或Java版本下载的其他资源,运行时环境的配置(最低J2SE版本,运行时选项,RAM等),使用扩展轻松管理公共资源.

..splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..

要查看操作方法,请访问演示.文件服务中,filetest.zip包含源文件,启动文件和构建文件.演示. ..

To see how it is done, visit the demo. of the file services, the filetest.zip contains the source, launch file and build file. The demo. ..

..提示用户将内容类型为text/sleepytime的文件扩展名.zzz(仅是不太可能与现有文件关联冲突的文件类型)相关联.

..prompts the user to associate file extension .zzz (simply a file type unlikely to clash with existing file associations) of content type text/sleepytime.

如果用户要求打开文件,则参数将为-open path/to/file.name或对于打印而言为-print path/to/file.name.

If the user asks to open a file, the arguments will be -open path/to/file.name or for print it will be -print path/to/file.name.

JWS随JRE一起提供,并且可以在OS X,Windows& * nix.

JWS is supplied with the JRE, and works on OS X, Windows & *nix.

这篇关于如何在OSX上将文件类型与(我的)Java应用程序关联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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