I'm trying to find a way to use
JDIC to associate a file type with a particular application, and it's not working for me. The ultimate goal is the I want a user to be able to be using, say, Windows Explorer, see a file, right click on it, and see an option pop up to invoke a particular program, passing the selected file as an argument. JDIC
seems to support this, particularly according to
this article. However in tests I've run so far, I haven't been able to observe it actually working. Here's some code I've tried:
The output I see (running on Windows 2000 Pro using JDIC 0.9.1) is:
Which is all well and good. The association did not exist initially (I chose .FOO as the filetype precisely because it is not associated with anything currently) and after calling registerAssociation, the association appears to exist - according to the
Java program. Good.
Unfortunately, this appears to have no observable effect outside the JVM. Going to Explorer -> Tools -> Folder Options -> File types, I don't see an association listed for FOO files, or a description saying XXXXXX. If I right click or double click on a samlple file with a .FOO extension, I don't start up TextPad, nor see an option to open with TextPad. This appears to be true whether I let the Java program exist, or keep the main
thread active with a prolonged sleep() call (shown commented out above). Closing Explorer and reopening it does not cause it to load new file associations, either.
So, does anyone have any ideas or suggestions on what I might be missing here? Thanks.
[ October 20, 2006: Message edited by: Jim Yingst ]