when i double click any file a default program will launch - how make it in java

for example if i create an extension like *.kylix and i would like it to asociate with my java program, So after user clicking file like
document.kylix my java program will recive through main(String…) file parameter etc. I know that Azeraus is using it for *.torrent files and i was wondering if it can be done in pure java code, of course i am not talking about manualy asociating by user (in windows it can be done in explorer folder menu) but as i said i would like it to make in pure java, probably it is not possible without native libs, but i would like to ask anyway.

theoreticaly i could make seperate *.jar files with simple class inside that could launch my program, it could be done everywhere where double clicking jar is working (becouse some older versions of winrar progs were asociating *.jar files to themselve not to java jre, but now they are not doing it). It is good solution but maybe it can be done in another way…

AFAIK this is OS dependant.

I know of no way to set file associations from Java.

I suspect Azureus sets it in their installer.

AFAIK this is OS dependant.

Yes.

I know of no way to set file associations from Java.

You can do that with webstart (1.5+) :slight_smile:

http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html#information

[quote]association element: The optional association element is a hint to the JNLP client that it wishes to be registered with the operating system as the primary handler of certain extensions and a certain mime-type. The association element must have the extensions and mime-type attributes.
[/quote]

I suspect Azureus sets it in their installer.

Yes.

Cooool!

thanx you all it was is very helpfull