2

I am making Scouting Software (in Java) for my FRC robotics team. Scouting is like collecting data on other teams' robots during competition. It is absolutely critical that my program makes that process as simple and easy as possible. My program can save its data in two ways, one of which is by writing a .scout file to the user's hard drive. All this is working well, but as a finishing touch i would like to implement a way to associate .scout files with my program so that .scout files are opened with my program. It's like .docx for Microsoft Word. It associates .doc/.docx/...etc to itself such that when the user clicks on a file with those extensions, Word opens itself up and then opens the file the user clicked on. I want something like this for my application. Keep in mind, it is written in Java and meant to work on different operating systems (Windows, OSX, Ubuntu Linux, etc).

Mohammad Adib
  • 788
  • 6
  • 19
  • 39
  • 3
    It is not provided through standard Java library in Java; it is native OS-specific feature. Under Windows, this can be done through Windows registry http://stackoverflow.com/questions/1387769/create-registry-entry-to-associate-file-extension-with-application-in-c. You can use installer builder like NSIS, InnoSetup, etc. to set a registry entry. Java Web Start (JWS) probably has a this feature to support cross-platform. – ee. Feb 17 '12 at 00:48
  • Thanks, that helps a lot :) been wasting a lot of time on this. – Mohammad Adib Feb 17 '12 at 00:53

1 Answers1

2

Does the program have a GUI? If so, launch it with Java Web Start.

JWS can associate a file-type with an application on Windows, OS X & *nix. Here is a demo. of the JNLP API file service that associates the .zzz file type with the demo. app.

Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433