The moose likes Swing / AWT / SWT and the fly likes File Extensions Mappings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "File Extensions Mappings" Watch "File Extensions Mappings" New topic

File Extensions Mappings

Jean-Philippe Pellet

Joined: Sep 10, 2003
Posts: 2
My application writes files with extension .xtp. How can I tell the OS (be it Windows, Mac OS X or another *nix) to use my compiled java application when I double-click on my .xtp file? Does my application have to be a jar archive? If possible I would like to do that in my code, but if it's not possible then how can I do it 'by hand'?
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
I am not familier with OS other than Windows. For Windows, you should use JNI to create a new Key under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts, and a node under it, with Value Name as Application, Value data as application - with which the file has to be opened.
I agree. Here's the link:
subject: File Extensions Mappings
It's not a secret anymore!