I want to be able to open a file with a JAR file.

In other words I want to be able to right click on a file, select an open with command, select myprogram.jar, and then execute myprogram.jar with the filename of that file as an argument. (Or something to that effect.)

How can I do this?