Viewing a file using default application associated with it
Joined: Sep 13, 2000
I have to make an application in which a box appears and from where I can select a file which will open in default application associated with it. Like .pdf files should open in Acrobat Reader and .htm in explorer and .doc in Word. Can somebody help?
Joined: Nov 22, 2008
In Windows, when the user tries to open a file, Windows searches the registry for a known file extention. If it finds one, it reads the registry entry to find out which application is to be used for that type of file. Then it opens the file using that app. If no matching entry can be found in the registry you will get the little dialog box telling you that the file type is unknown. It asks you to pick an application to use for opening this file. To duplicate this functionality in Java, you will have to use JNI to access the system registry.