开发者

Java - Creating a new file extension in a program

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.

Utilising a file association in a Java application

Create registry entry to associate file extension with application in C++

Associating file extensions with a program

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

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.

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!

  • 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, an开发者_StackOverflow中文版d 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 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜