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.