Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  when i double click any file a default program will launch - how make it in java  (Read 535 times)
0 Members and 2 Guests are viewing this topic.
Offline kylix999

Full Member
**

Posts: 193



« on: 2006-02-12 09:02:48 »

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...
Offline Jeff

JGO Kernel
*****

Posts: 3535


Got any cats?


« Reply #1 on: 2006-02-12 16:21:27 »

AFAIK this is OS dependant.

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

I suspect Azureus sets it in their installer.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline oNyx

JGO Kernel
*****

Posts: 2943
Medals: 5


pixels! :x


« Reply #2 on: 2006-02-12 16:38:57 »

>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+) Smiley

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.
>I suspect Azureus sets it in their installer.

Yes.

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Go get 'em!
Offline Jeff

JGO Kernel
*****

Posts: 3535


Got any cats?


« Reply #3 on: 2006-02-12 19:54:53 »


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

You can do that with webstart (1.5+) Smiley

Cooool!

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline kylix999

Full Member
**

Posts: 193



« Reply #4 on: 2006-02-13 00:33:12 »


thanx you all it was is very helpfull
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.105 seconds with 19 queries.