0

So I'm developing an application and it occurred to me that I need to have an easy way to open files. My application is somewhat similar to a word processor, and right now if I want to open a file right off the bat, I either have to have to go into a command line to launch my application, or I have to launch my application and navigate the menus in order to open a file. I eventually want to distribute my application, but this is obviously very inconvenient and non user friendly.

In Windows or Mac OS or whatever you use, when you are in your file explorer, you can double click on a file and it will be automatically opened with the default application for that file type. That is exactly what I want to do to open files, and I would also like to know how to set my application as the default program for a certain file type. How would I go about accomplishing this?

Nicholas Greene
  • 125
  • 2
  • 14
  • http://stackoverflow.com/questions/550329/how-to-open-a-file-with-the-default-associated-program – VirtualTroll Apr 18 '17 at 17:29
  • @VirtualTroll I saw that post, but it seemed as if it was answering the question of how to open a file from the Java application. I am trying to launch my java application (and automatically open a given file) from the native file system. – Nicholas Greene Apr 18 '17 at 17:37
  • Are you looking to change this just for yourself, or how to program you application to do it 'for the user' ? – djsmiley2kStaysInside Apr 18 '17 at 18:54
  • @djsmiley2k By that I assume you mean changing the default program to open certain file type. I do plan on distributing my application, so I wish to do it for the user, or ask the user for confirmation. – Nicholas Greene Apr 18 '17 at 18:58
  • 1
    Installer programs such as InstallShield can take care of that for you (if this is your case you should tag and edit your question accordingly). If you want to accomplish this via scripting, you can probably find better help on SuperUser. Check this question on how to accomplish this under Windows. – Laf Apr 18 '17 at 19:05
  • The question I was referring to is [here](https://superuser.com/questions/29717/). – Laf Apr 18 '17 at 19:11

0 Answers0