Java - 在程序中创建新的文件扩展名 [英] Java - Creating a new file extension in a program

查看:221
本文介绍了Java - 在程序中创建新的文件扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是为我正在创建的程序创建一个新的文件扩展名(可能不止一个)。所以,经过四处寻找之后,我找到了很多关于这个主题的资料,如下所示,以防万一有人想看看它们并得到我一直在看的内容。

I'm aiming to create a new file extension (possibly more than one) for a program I'm creating. So, after looking around for a bit, I found a number of sources on the subject, listed below, just in case anyone wants to look at them and get the general idea of what I have been looking at.

在Java中使用文件关联申请

创建注册表项以将文件扩展名与C ++中的应用程序相关联

将文件扩展名与程序相关联

< a href =http://support.microsoft.com/?scid=kb%3Ben-us%3B185453&x=6&y=11 =nofollow noreferrer> http://support.microsoft.com/ ?scid = kb%3Ben-us%3B185453& x = 6& y = 11

http://www.rgagnon.com/javadetails/java-0592.html

http://www.rgagnon.com /javadetails/java-0480.html

另外,请注意Microsoft支持的实际上是Visual Basic课程,但我只是想看看是否注册表中的任何相似之处都在变化。

Also, note that the Microsoft support one is actually a Visual Basic lesson, but I was just trying to see if there were any similarities in the registry changing.

他们中的大多数人都在谈论进行一些注册表编辑,以便Windows可以识别新文件并知道如何处理它。然后我偶然发现了甲骨文的这个文件,声称你能够用一些(看似)简单的Java代码完成上述所有工作。我觉得如果这很容易,有人会指出它。此外,该文件来自2006年。我有很多问题,我理解这些问题可能会有很多问题,所以如果有人抽出时间回答这个问题,那么谢谢你!

Most of them generally talk about doing some registry editing so that Windows can recognize the new file and know what to do with it. Then I stumbled upon this document by Oracle, which claims that you are able to do all of the above with some (seemingly) simple Java code. I figure if it's that easy, though, somebody would have pointed it out already. Also, that document is from 2006. I've got a number of questions, which I understand can be a lot to go through, so if anyone takes time out to answer this, thanks a bunch!


  • 创建和关联Java程序的文件类型的最佳方法是什么?

  • 如果使用Oracle方法,它是在完全独立的程序中完成的吗?我假设您不希望每次程序运行时都创建并关联文件类型,并且从我看到的,实际上会返回错误。

  • 我想要其他人(只有Windows用户)能够轻松安装程序,但我在Windows 7 64位上。我是否应该注意使关联与32位系统兼容?

  • 使用任何一种方法(即如果我只想创建),这些更改是否容易且完全可逆?一个测试文件扩展名)?

  • What's really the best way to go about creating and associating a file type for a Java program?
  • If the Oracle method is used, is it done in a completely separate program? I would assume you don't want the file type being created and associated every time the program runs, and from what I've seen, that will actually return errors.
  • I want other people (only Windows users) to be able to easily install the program, but I'm on Windows 7 64-bit. Are there any changes I should be aware of to make the association also compatible with 32-bit systems?
  • Are the changes easily and completely reversible with either method (i.e. if I just wanted to create a test file extension)?

我找不到任何广泛的资料来教授如何做这种没有先前知识的东西它,所以如果有人不能回答我的问题,但确实有一个很好的来源,我可以看一下,那也不错。

I couldn't find any extensive sources on teaching how to do this kind of stuff with no previous knowledge of it, so if anyone can't answer my questions, but does have a good source I can look at, that would be nice, too.

推荐答案

Java Web Start 不仅是来自Oracle的免费安装程序,而且它还会注册一个应用程序。对文件类型感兴趣。有关示例,请参阅文件服务演示

Java Web Start is not only a freely available installer that comes from Oracle, but it will also register an apps. interest in file types. See the File service demo. for an example.

这篇关于Java - 在程序中创建新的文件扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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