I would like my java application to automatically launch and display a .txt file when a user selects anything with that file type (The same behavior Microsoft word has when you select a .docx file)
I have followed the jpackage documentation here: https://docs.oracle.com/en/java/javase/14/jpackage/support-application-features.html#GUID-8D9F0607-91F4-4070-8823-02FCAB12238D
to setup file associations with my java application. I used this properties file to specify my application should open when a user selects a .txt file:
FAtext.properties:
mime-type=text/txt
extension=txt
description=Text source
This works. After installation my application starts when a user selects a .txt file.
However, my application doesn't actually open the .txt file because I am unsure how to provide the file name/location to my application.
I believe the solution is specifying another type of launcher with new args. For example:
OpenTxtFile.properties:
arguments=openTextFile locationOfTextFile
but how can I actually pass the locationOfTextFile argument to the launcher?