Help with java coding, Currently I have a gui set up so that the user can search
ID: 3680931 • Letter: H
Question
Help with java coding,
Currently I have a gui set up so that the user can search files and open them. My question is how do I set the java code so that when the user tries to open a .png file that It should use their default setting .png file viewer. Similarly I would have to do it for other types of files like .xlx , .ppt , . pdf , etc etc. So for example for a .pp file the program should automatically know to open their copy of power point if they have it or power point viewer etc. I would love it if you could show me the code for any two or more so I could get a feel for it.
Explanation / Answer
Try this,
or you can do it this with Desktop.open(File),
You can open pptx (and more) files as well with this approach
b) Even You can try like this