How do I make a custom file extension open my java program?

Hi there,

what I’m asking is how to make any associated file type open my program with the corresponding data. For example, if you have a .doc file it opens Microsoft word with whatever is saved to that file. I know how to associate the file extension to my program, but it just opens the program from the location of the file.
How do I make the program read the file upon start-up?