Well, basically, when you click on the item, you need to find the extension of the file, then use some SWITCH CASE or IF statement to determine which program to use. Then you will need to use Runtime.exec(args) to run the appropriate application. Most applications like Word and Excel will allow you to run a file and open the document like:
"excel.exe filename.xls"
That is the only way I can think of. Since application and file extension mapping is very OS specific, I can't see something like this being inherent in the
JAVA API anywhere.